aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-05-14 03:19:53 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-05-16 16:38:08 -0400
commit2430816b4e29fd9e6719ff46a4292d8f58565cff (patch)
tree2112067e8dd3f2ecc72b7c1d11dbb8b9afdcbe81 /net/wireless
parent2b9ccd4e4308272e5aec614b77c5385e7ec2ec90 (diff)
cfg80211: fix interface down/disconnect state handling
When the interface goes down, there's no need to call cfg80211_mlme_down() after __cfg80211_disconnect() as the latter will call the former (if appropriate.) Also, in __cfg80211_disconnect(), if the cfg80211 SME isn't used, __cfg80211_disconnected() may still need to be called (depending on the current state) so that the SME state gets cleared. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c1
-rw-r--r--net/wireless/sme.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 6c9f8005cac0..73405e00c800 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -870,7 +870,6 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
870#endif 870#endif
871 __cfg80211_disconnect(rdev, dev, 871 __cfg80211_disconnect(rdev, dev,
872 WLAN_REASON_DEAUTH_LEAVING, true); 872 WLAN_REASON_DEAUTH_LEAVING, true);
873 cfg80211_mlme_down(rdev, dev);
874 wdev_unlock(wdev); 873 wdev_unlock(wdev);
875 break; 874 break;
876 case NL80211_IFTYPE_MESH_POINT: 875 case NL80211_IFTYPE_MESH_POINT:
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index a9dc5c736df0..8b5eddfba1e5 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -961,7 +961,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
961 /* was it connected by userspace SME? */ 961 /* was it connected by userspace SME? */
962 if (!wdev->conn) { 962 if (!wdev->conn) {
963 cfg80211_mlme_down(rdev, dev); 963 cfg80211_mlme_down(rdev, dev);
964 return 0; 964 goto disconnect;
965 } 965 }
966 966
967 if (wdev->sme_state == CFG80211_SME_CONNECTING && 967 if (wdev->sme_state == CFG80211_SME_CONNECTING &&
@@ -987,6 +987,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
987 return err; 987 return err;
988 } 988 }
989 989
990 disconnect:
990 if (wdev->sme_state == CFG80211_SME_CONNECTED) 991 if (wdev->sme_state == CFG80211_SME_CONNECTED)
991 __cfg80211_disconnected(dev, NULL, 0, 0, false); 992 __cfg80211_disconnected(dev, NULL, 0, 0, false);
992 else if (wdev->sme_state == CFG80211_SME_CONNECTING) 993 else if (wdev->sme_state == CFG80211_SME_CONNECTING)