case RX_MGMT_CFG80211_ASSOC:
cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, skb->len);
break;
+ case RX_MGMT_CFG80211_DEAUTH:
+ cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len, NULL);
+ break;
default:
WARN(1, "unexpected: %d", rma);
}
}
}
- /* cfg80211 should catch this... */
- if (WARN_ON(!bssid)) {
+ /*
+ * cfg80211 should catch this ... but it's racy since
+ * we can receive a deauth frame, process it, hand it
+ * to cfg80211 while that's in a locked section already
+ * trying to tell us that the user wants to disconnect.
+ */
+ if (!bssid) {
mutex_unlock(&ifmgd->mtx);
return -ENOLINK;
}
mutex_lock(&ifmgd->mtx);
- /* cfg80211 should catch that */
- if (WARN_ON(&ifmgd->associated->cbss != req->bss)) {
+ /*
+ * cfg80211 should catch this ... but it's racy since
+ * we can receive a disassoc frame, process it, hand it
+ * to cfg80211 while that's in a locked section already
+ * trying to tell us that the user wants to disconnect.
+ */
+ if (&ifmgd->associated->cbss != req->bss) {
mutex_unlock(&ifmgd->mtx);
return -ENOLINK;
}