mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
watchdog: Use put_device on error
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>
This commit is contained in:
parent
5afb6d203d
commit
937425d4cd
1 changed files with 1 additions and 1 deletions
|
@ -1023,7 +1023,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