Skip to content

Commit 4b2dc39

Browse files
Yuuoniyalexandrebelloni
authored andcommitted
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: 8655940 ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220309092225.6930-1-linmq006@gmail.com
1 parent 3ae8fd4 commit 4b2dc39

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/rtc/rtc-gamecube.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ static int gamecube_rtc_read_offset_from_sram(struct priv *d)
235235
}
236236

237237
ret = of_address_to_resource(np, 0, &res);
238+
of_node_put(np);
238239
if (ret) {
239240
pr_err("no io memory range found\n");
240241
return -1;

0 commit comments

Comments
 (0)