Skip to contentSkip to conversation

cfg80211: fix more bugs in mlme handling

PATCH New Johannes Berg 1 participant 1 message Jul 10, 2009 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: fix more bugs in mlme handling

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.

---
 net/wireless/mlme.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
net/wireless/mlme.c +3 -5
@@ -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,