Skip to content

Commit

Permalink
rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Miaoqian Lin authored and Alexandre Belloni committed Mar 29, 2022
1 parent 3ae8fd4 commit 4b2dc39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rtc/rtc-gamecube.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4b2dc39

Please sign in to comment.