PCI: rcar: Release temporary device tree node reference
Subsystems (4)
PATCH v2 1/1 PCI: rcar: Release temporary device tree node reference
of_find_matching_node() returns a referenced node even when it is used only as a boolean test. Drop the reference right after the match check.
---
Changes in v2:
- Use an explicit of_node_put() instead of __free(device_node) (Marek Vasut)
- Switch to my oss.patchbox address
v1: https://lore.kernel.org/all/[email protected]/
drivers/pci/controller/pcie-rcar-host.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-rcar-host.c +5 -1
@@ -1122,7 +1122,11 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconststatic int __init rcar_pcie_init (void ) { -if (of_find_matching_node (NULL , rcar_pcie_abort_handler_of_match)) { +struct device_node *np; + + np =of_find_matching_node (NULL , rcar_pcie_abort_handler_of_match); +if (np) { +of_node_put (np);#ifdef CONFIG_ARM_LPAE hook_fault_code (17 , rcar_pcie_aarch32_abort_handler,SIGBUS ,0 ,"asynchronous external abort" );
base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines
of_find_matching_node()returns a referenced node even when it is used only as a boolean test. Drop the reference right after the match check.Fixes a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")Signed-off-by Yuho Choi <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · Yuho Choi
of_find_matching_node()returns a referenced node even when it is used only as a boolean test. Drop the reference right after the match check.Fixes a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")Signed-off-by Yuho Choi <[email protected]>---
Changes in v2:
- Use an explicitof_node_put()instead of__free(device_node)(Marek Vasut)
- Switch to my oss.patchbox address
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 5 lines · Yuho Choi
of_find_matching_node()returns a referenced node even when it is used only as a boolean test. Drop the reference right after the match check.Fixes a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")Signed-off-by Yuho Choi <[email protected]>
Thank you !
Quoted 1 line · Yuho Choi
PCI: rcar: Release temporary device tree node reference
Applied, thanks!
[1/1] PCI: rcar: Release temporary device tree node reference
commit: 186da40837a4a2472b8afbf7dbccbe1b1e0f16bf
Best regards,
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Quoted 2 lines · Yuho Choi
of_find_matching_node()returns a referenced node even when it is used only as a boolean test. Drop the reference right after the match check.
I guess this actually fixes an of_node reference leak, right?
Quoted 34 lines
Fixes a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")Signed-off-by Yuho Choi <[email protected]>---
Changes in v2:
- Use an explicitof_node_put()instead of__free(device_node)(Marek Vasut)
- Switch to my oss.patchbox addressv1: https://lore.kernel.org/all/[email protected]/
drivers/pci/controller/pcie-rcar-host.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-rcar-host.c +5
-1@@ -1122,7 +1122,11 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconststatic int __init rcar_pcie_init (void ) { -if (of_find_matching_node (NULL , rcar_pcie_abort_handler_of_match)) { +struct device_node *np; + + np =of_find_matching_node (NULL , rcar_pcie_abort_handler_of_match); +if (np) { +of_node_put (np);#ifdef CONFIG_ARM_LPAE hook_fault_code (17 , rcar_pcie_aarch32_abort_handler,SIGBUS ,0 ,"asynchronous external abort" );base-commit:
f0100363d8c374bd8e9ea7c9ba02744f0b802ca4Signature · 1 line
2.43.0