wil6210: fix secondary connect
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Mon, 17 Mar 2014 13:34:20 +0000 (15:34 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Mar 2014 17:44:18 +0000 (13:44 -0400)
when STA receiving connect() when already connected,
it should return error

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/wil6210/cfg80211.c

index f6a12e7f80beebdfc31ac93e6cc4622bfc2449c7..597540a307d8796527ad12f9024d10d4ad6b5c43 100644 (file)
@@ -327,6 +327,10 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
        int ch;
        int rc = 0;
 
+       if (test_bit(wil_status_fwconnecting, &wil->status) ||
+           test_bit(wil_status_fwconnected, &wil->status))
+               return -EALREADY;
+
        bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
                               sme->ssid, sme->ssid_len,
                               WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);