rndis_wlan: clear cfg80211 scan on rndis_wlan_stop()
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Thu, 30 Jul 2009 16:41:31 +0000 (19:41 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Aug 2009 20:44:16 +0000 (16:44 -0400)
Scanning gets stuck if device is stopped when scan is active. Fix by
clearing/aborting cfg80211 scan on rndis_wlan_stop().

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rndis_wlan.c

index 3c7c620c4f078fa9f457f777878ad83c7ddf97bf..dee05511d591a5b1b9dc45d490037d80e1da50d8 100644 (file)
@@ -1484,6 +1484,9 @@ static void rndis_get_scan_results(struct work_struct *work)
 
        devdbg(usbdev, "get_scan_results");
 
+       if (!priv->scan_request)
+               return;
+
        ret = rndis_check_bssid_list(usbdev);
 
        cfg80211_scan_done(priv->scan_request, ret < 0);
@@ -2522,6 +2525,11 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
        cancel_work_sync(&priv->work);
        flush_workqueue(priv->workqueue);
 
+       if (priv->scan_request) {
+               cfg80211_scan_done(priv->scan_request, true);
+               priv->scan_request = NULL;
+       }
+
        return retval;
 }