⬢ DragonFlyBSD Kernel Audit
DF-5259 / fix.diff
← back to finding ↓ download raw
--- a/sys/bus/u4b/wlan/if_mtw.c
+++ b/sys/bus/u4b/wlan/if_mtw.c
@@ -3851,11 +3851,14 @@
 		break;
 	}
 
+	MTW_LOCK(sc);
 	setbit(bo->bo_flags, item);
 	if (rvp->beacon_mbuf == NULL) {
 		rvp->beacon_mbuf = ieee80211_beacon_alloc(ni);
-		if (rvp->beacon_mbuf == NULL)
+		if (rvp->beacon_mbuf == NULL) {
+			MTW_UNLOCK(sc);
 			return;
+		}
 	}
 	ieee80211_beacon_update(ni, rvp->beacon_mbuf, mcast);
 
@@ -3864,6 +3867,7 @@
 	sc->cmdq[i].func = mtw_update_beacon_cb;
 	sc->cmdq[i].arg0 = vap;
 	ieee80211_runtask(ic, &sc->cmdq_task);
+	MTW_UNLOCK(sc);
 
 	return;
 }