watchdog: rti-wdt: fix reference leak in rti_wdt_probe
authorZhang Qilong <zhangqilong3@huawei.com>
Fri, 30 Oct 2020 15:49:09 +0000 (23:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:54 +0000 (14:56 +0100)
commit0aa2eecf8534177d5f8ad8aeeaa50abef3db4f3d
treeed5f684f4ca28c7946d1119f24206028a77e3adc
parenteae1fb3bc565ea3d6c88f4cc488cd0f35f5090c0
watchdog: rti-wdt: fix reference leak in rti_wdt_probe

[ Upstream commit 8711071e9700b67045fe5518161d63f7a03e3c9e ]

pm_runtime_get_sync() will increment pm usage counter even it
failed. Forgetting to call pm_runtime_put_noidle will result
in reference leak in rti_wdt_probe, so we should fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20201030154909.100023-1-zhangqilong3@huawei.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/rti_wdt.c