Re: [PATCH] PCI: rcar-gen4: Fix device_node leak in rcar_gen4_pcie_host_msi_addr()

From: Fuad Tabba

Date: Tue Sep 22 2026 - 02:42:35 EST


Hi Marek,

On Mon, 21 Sep 2026 22:47:30 +0200, Marek Vasut <marek.vasut@xxxxxxxxxxx> wrote:

[...]

> I think you have to call of_node_put() on msi_node(), so what about this
> instead ?

The __free(device_node) is that call: it puts msi_node on every return from the function, the success path included, so no goto is needed. It's the same scoped cleanup pci-imx6.c and pcie-rzg3s-host.c use for their device_node lookups.

> diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c

[...]

> "
>
> Also, I think drivers/pci/controller/pcie-iproc.c
> iproc_pcie_msi_enable() needs similar fix ?

I don't think so: iproc_pcie_msi_enable() already puts the node at out_put_node, on the steer failure and the success paths alike.

Cheers,
/fuad