Skip to content

Commit 143981a

Browse files
joehattoriWim Van Sebroeck
authored andcommitted
watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()
rti_wdt_probe() does not release the OF node reference obtained by of_parse_phandle(). Add a of_node_put() call. This was found by an experimental verification tool that I am developing. Due to the lack of the actual device, no runtime test was able to be performed. Fixes: f20ca59 ("watchdog:rit_wdt: Add support for WDIOF_CARDRESET") Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20250105111718.4184192-1-joe@pf.is.s.u-tokyo.ac.jp Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 7da5fc3 commit 143981a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/watchdog/rti_wdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
302302
node = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
303303
if (node) {
304304
ret = of_address_to_resource(node, 0, &res);
305+
of_node_put(node);
305306
if (ret) {
306307
dev_err(dev, "No memory address assigned to the region.\n");
307308
goto err_iomap;

0 commit comments

Comments
 (0)