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 <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>
This commit is contained in:
Amit Khatri 2015-11-30 12:46:52 +05:30 committed by Johannes Berg
parent 7d37fcd409
commit 89f44d8c25
1 changed files with 3 additions and 0 deletions

View File

@ -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_tx_info *info = IEEE80211_SKB_CB(tx_skb);
struct ieee80211_rate *txrate = ieee80211_get_tx_rate(hw, info); struct ieee80211_rate *txrate = ieee80211_get_tx_rate(hw, info);
if (WARN_ON(!txrate))
return;
if (!netif_running(hwsim_mon)) if (!netif_running(hwsim_mon))
return; return;