ath6kl: Check sme state before delivering disconnect event to cfg80211
authorRaja Mani <rmani@qca.qualcomm.com>
Fri, 12 Aug 2011 12:22:24 +0000 (17:52 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 31 Aug 2011 07:10:53 +0000 (10:10 +0300)
 In some random cases, the firmware is sending two disconnect event to
 the host. In the current model, both diconnect events are passed to
 cfg80211 without checking local sme state machine, which is screwing
 cfg80211 layer state.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c

index e88b519ed1b6ab1ee71962a37c8999d84f1eb82a..b2b70e6618f5e3a05f21fde3bfc566734cd7c0c7 100644 (file)
@@ -643,7 +643,7 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason,
                                                NULL, 0,
                                                WLAN_STATUS_UNSPECIFIED_FAILURE,
                                                GFP_KERNEL);
-               } else {
+               } else if (ar->sme_state == SME_CONNECTED) {
                        cfg80211_disconnected(ar->net_dev, reason,
                                              NULL, 0, GFP_KERNEL);
                }