diff options
author | Liang He <windhl@126.com> | 2022-06-20 21:02:21 +0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-09-05 17:28:27 +1000 |
commit | 3d31adc47edb6d0cef122a41fba1b639db5d1c37 (patch) | |
tree | d1fdf0c43dfb2ce6a89038fa07f13548be6e06fa /arch/powerpc/sysdev/fsl_pci.c | |
parent | cd772e659da0ad67f19f022f65449e14ebcf1284 (diff) |
powerpc/sysdev: Add missing of_node_put()s
Add of_node_put() in various paths to drop references once they are no
longer needed.
Signed-off-by: Liang He <windhl@126.com>
[mpe: Rewrite change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220620130221.4073228-1-windhl@126.com
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index af6c8ca824d3..4c3fd9f4cc7b 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -181,6 +181,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci, static bool is_kdump(void) { struct device_node *node; + bool ret; node = of_find_node_by_type(NULL, "memory"); if (!node) { @@ -188,7 +189,10 @@ static bool is_kdump(void) return false; } - return of_property_read_bool(node, "linux,usable-memory"); + ret = of_property_read_bool(node, "linux,usable-memory"); + of_node_put(node); + + return ret; } /* atmu setup for fsl pci/pcie controller */ |