Skip to content

Commit

Permalink
cfg80211: remove warning in deauth case
Browse files Browse the repository at this point in the history
It might be the case that __cfg80211_disconnected() has already
cleaned up wdev->current_bss() for us. The old code didn't catch
that situation and didn't warn needlessly.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Holger Schurig authored and John W. Linville committed Oct 27, 2009
1 parent ce47061 commit e0da41b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,13 @@ void __cfg80211_send_deauth(struct net_device *dev,
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buf;
const u8 *bssid = mgmt->bssid;
int i;
bool done = false;

ASSERT_WDEV_LOCK(wdev);

nl80211_send_deauth(rdev, dev, buf, len, GFP_KERNEL);

if (wdev->current_bss &&
memcmp(wdev->current_bss->pub.bssid, bssid, ETH_ALEN) == 0) {
done = true;
cfg80211_unhold_bss(wdev->current_bss);
cfg80211_put_bss(&wdev->current_bss->pub);
wdev->current_bss = NULL;
Expand All @@ -148,21 +146,17 @@ void __cfg80211_send_deauth(struct net_device *dev,
cfg80211_unhold_bss(wdev->auth_bsses[i]);
cfg80211_put_bss(&wdev->auth_bsses[i]->pub);
wdev->auth_bsses[i] = NULL;
done = true;
break;
}
if (wdev->authtry_bsses[i] &&
memcmp(wdev->authtry_bsses[i]->pub.bssid, bssid, ETH_ALEN) == 0) {
cfg80211_unhold_bss(wdev->authtry_bsses[i]);
cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
wdev->authtry_bsses[i] = NULL;
done = true;
break;
}
}

WARN_ON(!done);

if (wdev->sme_state == CFG80211_SME_CONNECTED) {
u16 reason_code;
bool from_ap;
Expand Down

0 comments on commit e0da41b

Please sign in to comment.