watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 11 May 2022 11:42:03 +0000 (15:42 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:09 +0000 (18:36 +0200)
commit7a4afd8a003d6abf1f5d159c2bb67e6b7cbde253
treead2bed5f000df88ae95a58722bbac063504c04be
parent5487a135c903b6aca59ca3a6c0f26fd46edc7fcb
watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe

[ Upstream commit 5d24df3d690809952528e7a19a43d84bc5b99d44 ]

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add  missing of_node_put() in some error paths.

Fixes: bf9006399939 ("watchdog: ts4800: add driver for TS-4800 watchdog")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220511114203.47420-1-linmq006@gmail.com
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>
drivers/watchdog/ts4800_wdt.c