mac80211_hwsim: check txrate for NULL
authorAmit Khatri <amit.khatri@samsung.com>
Mon, 30 Nov 2015 07:16:52 +0000 (12:46 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 4 Dec 2015 13:43:32 +0000 (14:43 +0100)
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>
drivers/net/wireless/mac80211_hwsim.c

index 194264c1ee1f2432c05048905fe6737c15b6ee21..297b192b9e13d5e0629bd4c51ad34a31f675c3ca 100644 (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_rate *txrate = ieee80211_get_tx_rate(hw, info);
 
+       if (WARN_ON(!txrate))
+               return;
+
        if (!netif_running(hwsim_mon))
                return;