* [PATCH] rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram
@ 2022-03-09 9:22 Miaoqian Lin
0 siblings, 0 replies; only message in thread
From: Miaoqian Lin @ 2022-03-09 9:22 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, Emmanuel Gil Peyrot,
Michael Ellerman, linux-rtc, linux-kernel
Cc: linmq006
The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.
Fixes: 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/rtc/rtc-gamecube.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/rtc-gamecube.c b/drivers/rtc/rtc-gamecube.c
index f717b36f4738..18ca3b38b2d0 100644
--- a/drivers/rtc/rtc-gamecube.c
+++ b/drivers/rtc/rtc-gamecube.c
@@ -235,6 +235,7 @@ static int gamecube_rtc_read_offset_from_sram(struct priv *d)
}
ret = of_address_to_resource(np, 0, &res);
+ of_node_put(np);
if (ret) {
pr_err("no io memory range found\n");
return -1;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-09 9:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 9:22 [PATCH] rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram Miaoqian Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).