Skip to contentSkip to conversation

rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram

PATCH New Miaoqian Lin 1 participant 1 message Mar 9, 2022 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/rtc/rtc-gamecube.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-gamecube.c +1 -0
index f717b36f4738..18ca3b38b2d0 100644
@@ -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;
Signature · 1 line
2.17.1