Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: john@phrozen.org
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] mac80211: add 802.11 encapsulation offloading support
Date: Tue, 7 Jan 2020 13:11:52 +0300	[thread overview]
Message-ID: <20200107101152.t2rl7l5nd2evsiyb@kili.mountain> (raw)

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

                 reply	other threads:[~2020-01-07 10:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200107101152.t2rl7l5nd2evsiyb@kili.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox