]> git.ipfire.org Git - people/arne_f/kernel.git/commit
watchdog: Fix NULL pointer dereference when releasing cdev
authorCurtis Klein <curtis.klein@hpe.com>
Wed, 23 Jun 2021 06:26:23 +0000 (23:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:39:29 +0000 (12:39 +0200)
commit08a901da171dc5dd4c54148fe3cc9704a4da4f44
treeac3975b9475dc0ffd7cbd0be7a7337204d9a4c55
parent59aba014840409c891e8ab2811a8e02054fbdded
watchdog: Fix NULL pointer dereference when releasing cdev

[ Upstream commit c7b178dae139f8857edc50888cfbf251cd974a38 ]

watchdog_hrtimer_pretimeout_stop needs the watchdog device to have a
valid pointer to the watchdog core data to stop the pretimeout hrtimer.
Therefore it needs to be called before the pointers are cleared in
watchdog_cdev_unregister.

Fixes: 7b7d2fdc8c3e ("watchdog: Add hrtimer-based pretimeout feature")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Curtis Klein <curtis.klein@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/1624429583-5720-1-git-send-email-curtis.klein@hpe.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/watchdog_dev.c