summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-02-28 15:35:37 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-03-01 17:25:42 +0100
commit4a0a1436053b17e50b7c88858fb0824326641793 (patch)
tree36fb9b21821ffca14f77cde7b2863ddb5cef3df5 /arch
parent200ed341b8646ea893d5466974d6e107c46237ba (diff)
mips: ralink: fix a refcount leak in ill_acc_of_setup()
of_node_put(np) needs to be called when pdev == NULL. Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/ralink/ill_acc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c
index 115a69fc20ca..f395ae218470 100644
--- a/arch/mips/ralink/ill_acc.c
+++ b/arch/mips/ralink/ill_acc.c
@@ -61,6 +61,7 @@ static int __init ill_acc_of_setup(void)
pdev = of_find_device_by_node(np);
if (!pdev) {
pr_err("%pOFn: failed to lookup pdev\n", np);
+ of_node_put(np);
return -EINVAL;
}