Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: avraham.stern@intel.com
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] iwlwifi: mvm: toggle tx antenna if tx fails during connection establishment
Date: Wed, 10 Feb 2021 13:54:57 +0300	[thread overview]
Message-ID: <YCO7gahK0ktH8YkY@mwanda> (raw)

[ Sorry, I don't know why Smatch is warning about a three year old bug
  and I'm not sure that it's blaming the correct commit but the warning
  looks correct.  - dan ]

Hello Avraham Stern,

This is a semi-automatic email about new static checker warnings.

The patch 0dde2440a77f: "iwlwifi: mvm: toggle tx antenna if tx fails
during connection establishment" from Jul 11, 2018, leads to the
following Smatch complaint:

    drivers/net/wireless/intel/iwlwifi/mvm/tx.c:356 iwl_mvm_set_tx_cmd_rate()
    error: we previously assumed 'sta' could be null (see line 341)

drivers/net/wireless/intel/iwlwifi/mvm/tx.c
   340	
   341		if (ieee80211_is_data(fc) && sta) {
                                             ^^^
This assumes that "sta" can be NULL.

   342			struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
   343	
   344			if (mvmsta->sta_state >= IEEE80211_STA_AUTHORIZED) {
   345				tx_cmd->initial_rate_index = 0;
   346				tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE);
   347				return;
   348			}
   349		} else if (ieee80211_is_back_req(fc)) {
   350			tx_cmd->tx_flags |=
   351				cpu_to_le32(TX_CMD_FLG_ACK | TX_CMD_FLG_BAR);
   352		}
   353	
   354		/* Set the rate in the TX cmd */
   355		tx_cmd->rate_n_flags =
   356			cpu_to_le32(iwl_mvm_get_tx_rate_n_flags(mvm, info, sta, fc));
                                                                           ^^^
It is dereferenced unconsiditionally inside the function.

   357	}
   358	

See also:
drivers/net/wireless/intel/iwlwifi/mvm/tx.c:486 iwl_mvm_set_tx_params() error: we previously assumed 'sta' could be null (see line 482)

regards,
dan carpenter

             reply	other threads:[~2021-02-10 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 10:54 Dan Carpenter [this message]
2021-02-10 12:26 ` [bug report] iwlwifi: mvm: toggle tx antenna if tx fails during connection establishment Stern, Avraham

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=YCO7gahK0ktH8YkY@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=avraham.stern@intel.com \
    --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