]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mld: fix smatch warning
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 27 May 2026 20:05:01 +0000 (23:05 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 3 Jun 2026 14:02:54 +0000 (17:02 +0300)
We dereference the mld_sta pointer before checking for NULL.
But we do check the sta pointer, and sta != NULL means mld_sta != NULL,
so there is no real issue.
Fix it anyway to silence the warning.

Link: https://patch.msgid.link/20260527200512.506707-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/tx.c

index 1e8716cbb4ce3f10fb37ace6d3a0744b1cd5d399..2185dade95f8cbfe137f4bc4c376dcb95c052ac9 100644 (file)
@@ -563,7 +563,8 @@ iwl_mld_fill_tx_cmd(struct iwl_mld *mld, struct sk_buff *skb,
         * - when no sta is given.
         * - frames that are sent to an NMI sta, which is only used for management.
         */
-       if (unlikely(!sta || mld_sta->vif->type == NL80211_IFTYPE_NAN ||
+       if (unlikely(!sta ||
+                    (mld_sta && mld_sta->vif->type == NL80211_IFTYPE_NAN) ||
                     info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT)) {
                flags |= IWL_TX_FLAGS_CMD_RATE;
                rate_n_flags = iwl_mld_get_tx_rate_n_flags(mld, info, sta,