aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/mlme.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 76c03daeb455..f60a83102ea2 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2003,6 +2003,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
2003 case RX_MGMT_CFG80211_ASSOC: 2003 case RX_MGMT_CFG80211_ASSOC:
2004 cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len); 2004 cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len);
2005 break; 2005 break;
2006 case RX_MGMT_CFG80211_DEAUTH:
2007 cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, NULL);
2008 break;
2006 default: 2009 default:
2007 WARN(1, "unexpected: %d", rma); 2010 WARN(1, "unexpected: %d", rma);
2008 } 2011 }
@@ -2498,8 +2501,13 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2498 } 2501 }
2499 } 2502 }
2500 2503
2501 /* cfg80211 should catch this... */ 2504 /*
2502 if (WARN_ON(!bssid)) { 2505 * cfg80211 should catch this ... but it's racy since
2506 * we can receive a deauth frame, process it, hand it
2507 * to cfg80211 while that's in a locked section already
2508 * trying to tell us that the user wants to disconnect.
2509 */
2510 if (!bssid) {
2503 mutex_unlock(&ifmgd->mtx); 2511 mutex_unlock(&ifmgd->mtx);
2504 return -ENOLINK; 2512 return -ENOLINK;
2505 } 2513 }
@@ -2524,8 +2532,13 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
2524 2532
2525 mutex_lock(&ifmgd->mtx); 2533 mutex_lock(&ifmgd->mtx);
2526 2534
2527 /* cfg80211 should catch that */ 2535 /*
2528 if (WARN_ON(&ifmgd->associated->cbss != req->bss)) { 2536 * cfg80211 should catch this ... but it's racy since
2537 * we can receive a disassoc frame, process it, hand it
2538 * to cfg80211 while that's in a locked section already
2539 * trying to tell us that the user wants to disconnect.
2540 */
2541 if (&ifmgd->associated->cbss != req->bss) {
2529 mutex_unlock(&ifmgd->mtx); 2542 mutex_unlock(&ifmgd->mtx);
2530 return -ENOLINK; 2543 return -ENOLINK;
2531 } 2544 }