Skip to content

Commit 0aa2eec

Browse files
Zhang Qilonggregkh
authored andcommitted
watchdog: rti-wdt: fix reference leak in rti_wdt_probe
[ Upstream commit 8711071 ] 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>
1 parent eae1fb3 commit 0aa2eec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/watchdog/rti_wdt.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,10 @@ static int rti_wdt_probe(struct platform_device *pdev)
227227

228228
pm_runtime_enable(dev);
229229
ret = pm_runtime_get_sync(dev);
230-
if (ret)
230+
if (ret) {
231+
pm_runtime_put_noidle(dev);
231232
return dev_err_probe(dev, ret, "runtime pm failed\n");
233+
}
232234

233235
platform_set_drvdata(pdev, wdt);
234236

0 commit comments

Comments
 (0)