Skip to content

Commit 89f44d8

Browse files
Amit Khatrijmberg-intel
authored andcommitted
mac80211_hwsim: check txrate for NULL
If the rate control algorithm messed up then the txrate pointer here could be NULL - WARN and drop the packet from monitoring. Signed-off-by: Amit Khatri <[email protected]> Signed-off-by: Rahul Jain <[email protected]> [rewrite commit message, add warning] Signed-off-by: Johannes Berg <[email protected]>
1 parent 7d37fcd commit 89f44d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw,
814814
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_skb);
815815
struct ieee80211_rate *txrate = ieee80211_get_tx_rate(hw, info);
816816

817+
if (WARN_ON(!txrate))
818+
return;
819+
817820
if (!netif_running(hwsim_mon))
818821
return;
819822

0 commit comments

Comments
 (0)