diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-05-14 11:19:53 +0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-17 00:38:08 +0400 |
commit | 2430816b4e29fd9e6719ff46a4292d8f58565cff (patch) | |
tree | 2112067e8dd3f2ecc72b7c1d11dbb8b9afdcbe81 /net/wireless/sme.c | |
parent | 2b9ccd4e4308272e5aec614b77c5385e7ec2ec90 (diff) | |
download | linux-2430816b4e29fd9e6719ff46a4292d8f58565cff.tar.xz |
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/sme.c')
-rw-r--r-- | net/wireless/sme.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, /* was it connected by userspace SME? */ if (!wdev->conn) { cfg80211_mlme_down(rdev, dev); - return 0; + goto disconnect; } if (wdev->sme_state == CFG80211_SME_CONNECTING && @@ -987,6 +987,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev, return err; } + disconnect: if (wdev->sme_state == CFG80211_SME_CONNECTED) __cfg80211_disconnected(dev, NULL, 0, 0, false); else if (wdev->sme_state == CFG80211_SME_CONNECTING) |