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

From: Marek Vasut

Date: Wed Sep 23 2026 - 14:46:34 EST


On 9/23/26 8:07 PM, Fuad Tabba wrote:
rcar_gen4_pcie_host_msi_addr() calls of_msi_xlate() with *msi_np NULL,
so it receives the MSI controller node with a reference held, and every
return past the NULL check leaks that reference, the success path
included. Declare msi_node with __free(device_node) so it's put on
every return.

Fixes: 8d6af27c0a73 ("PCI: rcar-gen4: Configure AXIINTC if iMSI-RX is not used")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/linux-pci/20260905213855.8D6671F00A3D@xxxxxxxxxxxxxxx/
Tested-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxxxx> # Retronix R-Car V4H Sparrow Hawk
Reviewed-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxxxx>
Signed-off-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>
I liked V1 a bit better, but either way works.