Skip to content

Commit

Permalink
mac80211_hwsim: check txrate for NULL
Browse files Browse the repository at this point in the history
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 <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
[rewrite commit message, add warning]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Amit Khatri authored and Johannes Berg committed Dec 4, 2015
1 parent 7d37fcd commit 89f44d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_skb);
struct ieee80211_rate *txrate = ieee80211_get_tx_rate(hw, info);

if (WARN_ON(!txrate))
return;

if (!netif_running(hwsim_mon))
return;

Expand Down

0 comments on commit 89f44d8

Please sign in to comment.