diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 62d29feabb0..8daa2fa4dc8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5024,6 +5024,7 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct ieee80211_ampdu_params params = { }; int error; uint8_t tid; + bool ic_locked; ic = ni->ni_ic; lhw = ic->ic_softc; @@ -5061,11 +5062,14 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) params.tid = tid; params.amsdu = false; - // IEEE80211_UNLOCK(ic); + ic_locked = IEEE80211_IS_LOCKED(ic); + if (ic_locked) + IEEE80211_UNLOCK(ic); LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); LKPI_80211_LHW_UNLOCK(lhw); - // IEEE80211_LOCK(ic); + if (ic_locked) + IEEE80211_LOCK(ic); if (error != 0) ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap);