[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220309092225.6930-1-linmq006@gmail.com>
Date: Wed, 9 Mar 2022 09:22:25 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>,
Michael Ellerman <mpe@...erman.id.au>,
linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram
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@...il.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
Powered by blists - more mailing lists