* [PATCH] cfg80211: fix more bugs in mlme handling
@ 2009-07-10 22:17 Johannes Berg
0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2009-07-10 22:17 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
The "what-was-I-thinking-if-anything" patch. Clearly,
if cfg80211_send_disassoc() does wdev_lock() and then
calls __cfg80211_send_disassoc(), the latter shouldn't
lock again. And the sme_state test is ... no further
comments.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/mlme.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- wireless-testing.orig/net/wireless/mlme.c 2009-07-11 00:13:50.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2009-07-11 00:14:15.000000000 +0200
@@ -178,12 +178,12 @@ static void __cfg80211_send_disassoc(str
bool from_ap;
bool done = false;
- wdev_lock(wdev);
+ ASSERT_WDEV_LOCK(wdev);
nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL);
- if (!wdev->sme_state == CFG80211_SME_CONNECTED)
- goto out;
+ if (wdev->sme_state != CFG80211_SME_CONNECTED)
+ return;
if (wdev->current_bss &&
memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) {
@@ -205,8 +205,6 @@ static void __cfg80211_send_disassoc(str
from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0;
__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap);
- out:
- wdev_unlock(wdev);
}
void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-10 22:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-10 22:17 [PATCH] cfg80211: fix more bugs in mlme handling Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox