From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] cfg80211: fix disassoc while not associated
Date: Mon, 27 Jul 2009 10:22:28 +0200 [thread overview]
Message-ID: <1248682948.19945.27.camel@johannes.local> (raw)
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>
---
net/wireless/mlme.c | 6 ++++++
1 file changed, 6 insertions(+)
--- wireless-testing.orig/net/wireless/mlme.c 2009-07-27 10:20:17.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2009-07-27 10:20:56.000000000 +0200
@@ -545,6 +545,12 @@ static int __cfg80211_mlme_disassoc(stru
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;
next reply other threads:[~2009-07-27 8:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 8:22 Johannes Berg [this message]
2009-07-28 19:53 ` [PATCH] cfg80211: fix disassoc while not associated Maxim Levitsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1248682948.19945.27.camel@johannes.local \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=maximlevitsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox