diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-27 10:22:28 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-29 15:46:11 -0400 |
commit | f9d6b402603a63b5e5b56bd7a79fa72a818be55b (patch) | |
tree | f1568e0d82005fb40186d5436627841be053ac87 | |
parent | fec247c0d5bfbaa0861774ce31d515bbd48f7fce (diff) | |
download | blackbird-op-linux-f9d6b402603a63b5e5b56bd7a79fa72a818be55b.tar.gz blackbird-op-linux-f9d6b402603a63b5e5b56bd7a79fa72a818be55b.zip |
cfg80211: fix disassoc while not associated
When trying to disassociate while not associated,
the kernel would crash rather than refusing the
operation, fix this;
Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/wireless/mlme.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 5b9b22120824..30058a80d7af 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -545,6 +545,12 @@ static int __cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev, ASSERT_WDEV_LOCK(wdev); + if (wdev->sme_state != CFG80211_SME_CONNECTED) + return -ENOTCONN; + + if (WARN_ON(!wdev->current_bss)) + return -ENOTCONN; + memset(&req, 0, sizeof(req)); req.reason_code = reason; req.ie = ie; |