Skip to contentSkip to conversation

wifi: iwlwifi: mvm: fix NULL deref in iwl_mvm_mld_disable_txq

PATCH New [email protected] 1 participant 1 message Mar 23, 2023 Intel wireless wifi link (iwlwifi)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: iwlwifi: mvm: fix NULL deref in iwl_mvm_mld_disable_txq

From: Gregory Greenman <[email protected]>

Handle NULL sta pointer.

---
 drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +6 -1
index d81fc9207ef0..51532b6379e2 100644
@@ -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);
Signature · 1 line
2.38.1