* [PATCH] firmware: Fix refcount leak bug in trusted_foundation
@ 2022-06-17 13:35 Liang He
0 siblings, 0 replies; only message in thread
From: Liang He @ 2022-06-17 13:35 UTC (permalink / raw)
To: linux-kernel; +Cc: Liang He
In of_register_trusted_foundations(), of_find_compatible_node() 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>
---
drivers/firmware/trusted_foundations.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/firmware/trusted_foundations.c b/drivers/firmware/trusted_foundations.c
index 1389fa9418a7..74ef947f5547 100644
--- a/drivers/firmware/trusted_foundations.c
+++ b/drivers/firmware/trusted_foundations.c
@@ -173,6 +173,7 @@ void of_register_trusted_foundations(void)
panic("Trusted Foundation: missing version-major property\n");
err = of_property_read_u32(node, "tlm,version-minor",
&pdata.version_minor);
+ of_node_put(node);
if (err != 0)
panic("Trusted Foundation: missing version-minor property\n");
register_trusted_foundations(&pdata);
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-17 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17 13:35 [PATCH] firmware: Fix refcount leak bug in trusted_foundation Liang He
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.