Re: [PATCH] PCI: rzg3s-host: Fix device node reference leak in rzg3s_pcie_host_parse_port()

From: Claudiu Beznea

Date: Wed Feb 04 2026 - 07:37:09 EST




On 2/3/26 18:46, Felix Gu wrote:
In rzg3s_pcie_host_parse_port(), of_get_next_child() returns a device
node with an incremented reference count that must be released with
of_node_put(). The current code fails to call of_node_put() which
causes a reference leak.

Use the __free(device_node) attribute to ensure automatic cleanup when
the variable goes out of scope.

Fixes: 7ef502fb35b2 ("PCI: Add Renesas RZ/G3S host controller driver")
Signed-off-by: Felix Gu <ustc.gu@xxxxxxxxx>


Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>