summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>2025-01-05 20:17:18 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:02:02 +0100
commitd89daf94506ebb6d6ef5db6045d39684e2c3e133 (patch)
tree6824e27fa466f4f1856fb1b06d6c4633fb95e60f /drivers/watchdog
parent57472ff9d1aab78db25093182538a0dd7487f760 (diff)
downloadlinux-d89daf94506ebb6d6ef5db6045d39684e2c3e133.tar.gz
linux-d89daf94506ebb6d6ef5db6045d39684e2c3e133.tar.bz2
linux-d89daf94506ebb6d6ef5db6045d39684e2c3e133.zip
watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()
[ Upstream commit 143981aa63f33d469a55a55fd9fb81cd90109672 ] 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: f20ca595ae23 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/rti_wdt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index 58c9445c0f88..255ece133576 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -301,6 +301,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
node = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
if (node) {
ret = of_address_to_resource(node, 0, &res);
+ of_node_put(node);
if (ret) {
dev_err(dev, "No memory address assigned to the region.\n");
goto err_iomap;