net: wireless: bcmdhd: Fix watchdog firing in softirq on removal
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 2 Jun 2011 23:08:37 +0000 (16:08 -0700)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:10:02 +0000 (09:10 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c

index 359384583e011f48224750b325266ac6f244fafa..8513fcc661358616f31887aaf7123475e20a3aa4 100644 (file)
@@ -2901,9 +2901,6 @@ dhd_bus_detach(dhd_pub_t *dhdp)
                        /* Stop the bus module */
                        dhd_bus_stop(dhd->pub.bus, TRUE);
 
-                       /* Clear the watchdog timer */
-                       dhd->wd_timer_valid = FALSE;
-                       del_timer_sync(&dhd->timer);
 #if defined(OOB_INTR_ONLY)
                        bcmsdh_unregister_oob_intr();
 #endif /* defined(OOB_INTR_ONLY) */
@@ -2985,6 +2982,10 @@ void dhd_detach(dhd_pub_t *dhdp)
        }
        }
 
+       /* Clear the watchdog timer */
+       dhd->wd_timer_valid = FALSE;
+       del_timer_sync(&dhd->timer);
+
        if (dhd->dhd_state & DHD_ATTACH_STATE_THREADS_CREATED) {
 #ifdef DHDTHREAD
                if (dhd->thr_wdt_ctl.thr_pid >= 0) {