diff options
author | Gregory Greenman <gregory.greenman@intel.com> | 2023-05-14 12:15:49 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-05-16 10:27:04 -0700 |
commit | 6818266283d191549afa87ac5d7b86635a5fb105 (patch) | |
tree | 79f2a808550fd9e69c2a1495e879057f53e6cdc6 /drivers/net/wireless/intel/iwlwifi/mvm/tx.c | |
parent | wifi: iwlwifi: fw: fix DBGI dump (diff) | |
download | wireguard-linux-6818266283d191549afa87ac5d7b86635a5fb105.tar.xz wireguard-linux-6818266283d191549afa87ac5d7b86635a5fb105.zip |
wifi: iwlwifi: mvm: fix access to fw_id_to_mac_id
RCU protected fw_id_to_mac_id can be initialized with either
an error code or NULL. Thus, after dereferencing need to check
the value with IS_ERR_OR_NULL() and not only that it is not NULL.
Fix it.
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230514120631.ec5f2880e81c.Ifa8c0f451df2835bde800f5c3670cc46238a3bd8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index 10d7178f1071..00719e130438 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -1875,7 +1875,7 @@ static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm, mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id); sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); - if (WARN_ON_ONCE(!sta || !sta->wme)) { + if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta) || !sta->wme)) { rcu_read_unlock(); return; } |