* [PATCH] powerpc: sysdev: Fix refcount leak bug in mpic_msgr
@ 2022-06-17 15:12 Liang He
0 siblings, 0 replies; only message in thread
From: Liang He @ 2022-06-17 15:12 UTC (permalink / raw)
To: mpe, benh, paulus, christophe.leroy, joel
Cc: windhl, linuxppc-dev, linux-kernel
In mpic_msgr_number_of_blocks() and mpic_msgr_block_number(),
of_find_node_by_name() will return a node pointer with refcount
incremented. We should use of_node_put() when it is not used
anymore.
Signed-off-by: Liang He <windhl@126.com>
---
arch/powerpc/sysdev/mpic_msgr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index 698fefaaa6dd..c2a235d9eb09 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -122,6 +122,7 @@ static unsigned int mpic_msgr_number_of_blocks(void)
count += 1;
}
}
+ of_node_put(aliases);
return count;
}
@@ -150,6 +151,7 @@ static int mpic_msgr_block_number(struct device_node *node)
if (node == of_find_node_by_path(prop->value))
break;
}
+ of_node_put(aliases);
return index == number_of_blocks ? -1 : index;
}
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-17 15:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17 15:12 [PATCH] powerpc: sysdev: Fix refcount leak bug in mpic_msgr Liang He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®