diff options
| author | Miaoqian Lin <[email protected]> | 2022-03-09 09:22:25 +0000 |
|---|---|---|
| committer | Alexandre Belloni <[email protected]> | 2022-03-29 20:45:50 +0000 |
| commit | 4b2dc39ca024990abe36ad5d145c4fe0c06afd34 (patch) | |
| tree | 5b62ad8e7fb0bec7ef3037df56d44be4d3020498 /drivers/rtc | |
| parent | rtc: mc146818-lib: Fix the AltCentury for AMD platforms (diff) | |
| download | kernel-4b2dc39ca024990abe36ad5d145c4fe0c06afd34.tar.gz kernel-4b2dc39ca024990abe36ad5d145c4fe0c06afd34.zip | |
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 <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-gamecube.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |
