summaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-08-19 14:24:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-19 14:24:45 -0400
commit22f0d2d1e7e76758f75887e616f2976323f85c26 (patch)
tree9470a4a7f4fe9deac91bd5bba2dbd9bfd6e7c84d /net/wireless/sme.c
parent0f7dd1aa8f959216f1faa71513b9d3c1a9065e5a (diff)
parent48c3e371350701444db51e8b35b5928d74dbacc3 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 81c8a10d743..20e86a95dc4 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
struct net_device *dev, u16 reason, bool wextev)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
- int err;
+ int err = 0;
ASSERT_WDEV_LOCK(wdev);
kfree(wdev->connect_keys);
wdev->connect_keys = NULL;
- if (wdev->conn) {
+ if (wdev->conn)
err = cfg80211_sme_disconnect(wdev, reason);
- } else if (!rdev->ops->disconnect) {
+ else if (!rdev->ops->disconnect)
cfg80211_mlme_down(rdev, dev);
- err = 0;
- } else {
+ else if (wdev->current_bss)
err = rdev_disconnect(rdev, dev, reason);
- }
return err;
}