Search Linux Wireless

[bug report] mac80211: add 802.11 encapsulation offloading support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello John Crispin,

The patch 50ff477a8639: "mac80211: add 802.11 encapsulation
offloading support" from Nov 25, 2019, leads to the following static
checker warning:

	net/mac80211/status.c:1227 ieee80211_tx_status_8023()
	warn: 'sta' can also be NULL

net/mac80211/status.c
  1201  void ieee80211_tx_status_8023(struct ieee80211_hw *hw,
  1202                                struct ieee80211_vif *vif,
  1203                                struct sk_buff *skb)
  1204  {
  1205          struct ieee80211_local *local = hw_to_local(hw);
  1206          struct ieee80211_sub_if_data *sdata;
  1207          struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  1208          struct sta_info *sta;
  1209          int retry_count;
  1210          int rates_idx;
  1211          bool acked;
  1212  
  1213          sdata = vif_to_sdata(vif);
  1214  
  1215          acked = info->flags & IEEE80211_TX_STAT_ACK;
  1216          rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
  1217  
  1218          rcu_read_lock();
  1219  
  1220          if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
                                                        ^^^^

This can be NULL for NL80211_IFTYPE_MESH_POINT (possibly that doesn't
matter here, I don't know the code).

  1221                  goto counters_update;
  1222  
  1223          if (IS_ERR(sta))
  1224                  goto counters_update;
  1225  
  1226          if (!acked)
  1227                  sta->status_stats.retry_failed++;
  1228  
  1229          if (rates_idx != -1)
  1230                  sta->tx_stats.last_rate = info->status.rates[rates_idx];
                        ^^^^^^^^^^^^^^^^^^^^^^^
Smatch warning.

  1231  
  1232          sta->status_stats.retry_count += retry_count;
  1233  

regards,
dan carpenter



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux