mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
watchdog: Use put_device on error
[ Upstream commit937425d4cd
] We should use put_device() instead of freeing device directly after device_initialize(). Fixes:cb36e29bb0
("watchdog: initialize device before misc_register") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200824031230.31050-1-dinghao.liu@zju.edu.cn 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>
This commit is contained in:
parent
a8bbb47d94
commit
dbb9ef1777
1 changed files with 1 additions and 1 deletions
|
@ -1000,7 +1000,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)
|
|||
pr_err("%s: a legacy watchdog module is probably present.\n",
|
||||
wdd->info->identity);
|
||||
old_wd_data = NULL;
|
||||
kfree(wd_data);
|
||||
put_device(&wd_data->dev);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue