From: Corey Minyard <cminyard@xxxxxxxxxx> Otherwise it could be used after being freed. Signed-off-by: Corey Minyard <cminyard@xxxxxxxxxx> --- drivers/watchdog/watchdog_pretimeout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/watchdog/watchdog_pretimeout.c b/drivers/watchdog/watchdog_pretimeout.c index 01ca84be240f..b45041b0ef39 100644 --- a/drivers/watchdog/watchdog_pretimeout.c +++ b/drivers/watchdog/watchdog_pretimeout.c @@ -162,6 +162,8 @@ void watchdog_unregister_governor(struct watchdog_governor *gov) break; } } + if (gov == default_gov) + default_gov = NULL; spin_lock_irq(&pretimeout_lock); list_for_each_entry(p, &pretimeout_list, entry) -- 2.17.1