[PATCH 4/5] watchdog: dw_wdt: unqueue timer on device removal

From: Ian Abbott
Date: Fri Jun 26 2015 - 09:22:20 EST


The watchdog device's timer may be queued when the platform driver
"remove" function is called. Call `del_timer_sync` to remove it from
the queue.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
drivers/watchdog/dw_wdt.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index 1cd877b..daab90b 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -387,6 +387,8 @@ out_unmark_probed:

static int dw_wdt_drv_remove(struct platform_device *pdev)
{
+ del_timer_sync(&dw_wdt.timer);
+
if (test_and_clear_bit(DW_WDT_RESTART_HANDLER, &dw_wdt.state))
unregister_restart_handler(&dw_wdt.restart_handler);

--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/