Commit 596a07c1 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 930c06f2
...@@ -178,12 +178,12 @@ static void __cfg80211_send_disassoc(struct net_device *dev, ...@@ -178,12 +178,12 @@ static void __cfg80211_send_disassoc(struct net_device *dev,
bool from_ap; bool from_ap;
bool done = false; bool done = false;
wdev_lock(wdev); ASSERT_WDEV_LOCK(wdev);
nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL); nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL);
if (!wdev->sme_state == CFG80211_SME_CONNECTED) if (wdev->sme_state != CFG80211_SME_CONNECTED)
goto out; return;
if (wdev->current_bss && if (wdev->current_bss &&
memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) { memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) {
...@@ -205,8 +205,6 @@ static void __cfg80211_send_disassoc(struct net_device *dev, ...@@ -205,8 +205,6 @@ static void __cfg80211_send_disassoc(struct net_device *dev,
from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0; from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0;
__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap); __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, void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment