diff options
author | Gregory Greenman <gregory.greenman@intel.com> | 2023-03-24 00:35:43 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-03-24 10:53:48 +0100 |
commit | d24b2130146b31d2185296dbc08186fb67bb2c71 (patch) | |
tree | 7bd2aa9891d6332ef34b6cd44058dfdb6a67a4e7 | |
parent | 0dd45ebc08de2449efe1a0908147796856a5f824 (diff) |
wifi: iwlwifi: mvm: fix NULL deref in iwl_mvm_mld_disable_txq
Check sta pointer for NULL and don't crash if it is.
Fixes: 006c152ac9e5 ("wifi: iwlwifi: mvm: add support for the new STA related commands")
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/linux-wireless/20230314194113.132873ce015c.I7b12a77e5be066730762e6ceeeaa7190293c3df1@changeid/
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index d81fc9207ef0..51532b6379e2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -227,10 +227,15 @@ static int iwl_mvm_mld_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, u16 *queueptr, u8 tid) { - struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_sta *mvmsta; int queue = *queueptr; int ret = 0; + if (!sta) + return -EINVAL; + + mvmsta = iwl_mvm_sta_from_mac80211(sta); + if (mvm->sta_remove_requires_queue_remove) { u32 cmd_id = WIDE_ID(DATA_PATH_GROUP, SCD_QUEUE_CONFIG_CMD); |