diff options
author | Amit Khatri <amit.khatri@samsung.com> | 2015-11-30 10:16:52 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-12-04 16:43:32 +0300 |
commit | 89f44d8c25bb21f167d7d124c6b83dd494f948af (patch) | |
tree | d3bee2856598d8015314dfd90e424cfd2b7e2757 /drivers/net/wireless/mac80211_hwsim.c | |
parent | 7d37fcd409199f76da522e6f6670a354ac468002 (diff) | |
download | linux-89f44d8c25bb21f167d7d124c6b83dd494f948af.tar.xz |
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>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 194264c1ee1f..297b192b9e13 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -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; |