Skip to content

Commit

Permalink
iwm/iwx: Ensure aggregate operation on RUN state, this avoids new sta…
Browse files Browse the repository at this point in the history
…te thread racing with systq thread and causing unexpected issue like firmware crash or double free objects etc.
  • Loading branch information
zxystd committed Mar 14, 2024
1 parent 83e09bf commit 6dc344d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions itlwm/hal_iwm/mac80211.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2805,6 +2805,9 @@ iwm_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
tid > IWM_MAX_TID_COUNT)
return ENOSPC;

if (ic->ic_state != IEEE80211_S_RUN)
return ENOSPC;

if (sc->ba_rx.start_tidmask & (1 << tid))
return EBUSY;

Expand All @@ -2828,6 +2831,9 @@ iwm_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni,
if (tid > IWM_MAX_TID_COUNT || sc->ba_rx.stop_tidmask & (1 << tid))
return;

if (ic->ic_state != IEEE80211_S_RUN)
return;

sc->ba_rx.stop_tidmask |= (1 << tid);
that->iwm_add_task(sc, systq, &sc->ba_task);
}
Expand Down
6 changes: 6 additions & 0 deletions itlwm/hal_iwx/ItlIwx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4452,6 +4452,9 @@ iwx_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
tid >= IWX_MAX_TID_COUNT)
return ENOSPC;

if (ic->ic_state != IEEE80211_S_RUN)
return ENOSPC;

if (sc->ba_rx.start_tidmask & (1 << tid))
return EBUSY;

Expand All @@ -4475,6 +4478,9 @@ iwx_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni,
if (tid >= IWX_MAX_TID_COUNT || sc->ba_rx.stop_tidmask & (1 << tid))
return;

if (ic->ic_state != IEEE80211_S_RUN)
return;

sc->ba_rx.stop_tidmask |= (1 << tid);
that->iwx_add_task(sc, systq, &sc->ba_task);
}
Expand Down

0 comments on commit 6dc344d

Please sign in to comment.