net: wireless: bcmdhd: Fix crash on timeout in wl_notify_escan_complete
Dmitry Shmidt [Tue, 13 Mar 2012 00:33:52 +0000 (17:33 -0700)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/wl_cfg80211.c

index 0b0baf0..0225709 100644 (file)
@@ -5882,7 +5882,7 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl,
                                ndev, wl_to_prmry_ndev(wl), wl->p2p_net));
                dev = ndev;
        }
-       if (fw_abort) {
+       if (fw_abort && !in_atomic()) {
                /* Our scan params only need space for 1 channel and 0 ssids */
                params = wl_cfg80211_scan_alloc_params(-1, 0, &params_size);
                if (params == NULL) {
@@ -5896,7 +5896,8 @@ static s32 wl_notify_escan_complete(struct wl_priv *wl,
                        }
                }
        }
-       del_timer_sync(&wl->scan_timeout);
+       if (!in_atomic())
+               del_timer_sync(&wl->scan_timeout);
        spin_lock_irqsave(&wl->cfgdrv_lock, flags);
 
 #ifdef WL_SCHED_SCAN