]> git.baikalelectronics.ru Git - kernel.git/commit
watchdog: core: fix null pointer dereference when releasing cdev
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 28 Aug 2018 10:13:47 +0000 (12:13 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Tue, 2 Oct 2018 11:32:24 +0000 (13:32 +0200)
commit031ccc21990ffcca3c0989d93c7a05a0f6a63b32
tree21362448aa15c3147f1cb97e5a07863632602e5b
parent99a86fea303b937d7ae55a5e531ff779d81484a2
watchdog: core: fix null pointer dereference when releasing cdev

watchdog_stop() calls watchdog_update_worker() which needs a valid
wdd->wd_data pointer. So, when unregistering the cdev, clear the
pointers after we call watchdog_stop(), not before.

Fixes: 6639611a5b0a ("watchdog: Introduce watchdog_stop_on_unregister helper")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/watchdog_dev.c