[PATCH v1] PCI: rcar: Release temporary device tree node reference
Yuho Choi <[email protected]> Sat, 1 Aug 2026 19:38:41 -0400
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
of_find_matching_node() returns a referenced node even when it is used
only as a boolean test. Keep the result in a scoped cleanup variable
so the reference is released after the match check.
Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook")
Signed-off-by: Yuho Choi <[email protected]>
---
drivers/pci/controller/pcie-rcar-host.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index cd9171eebc28..7ed1bc0732ce 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -1122,7 +1122,10 @@ static const struct of_device_id rcar_pcie_abort_handler_of_match[] __initconst
static int __init rcar_pcie_init(void)
{
- if (of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match)) {
+ struct device_node *np __free(device_node) =
+ of_find_matching_node(NULL, rcar_pcie_abort_handler_of_match);
+
+ if (np) {
#ifdef CONFIG_ARM_LPAE
hook_fault_code(17, rcar_pcie_aarch32_abort_handler, SIGBUS, 0,
"asynchronous external abort");
--
2.43.0