Skip to contentSkip to conversation

wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()

PATCH In review Dan Carpenter 3 participants 4 messages Sep 27, 2023 – Oct 26, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()

This error path should return -EINVAL instead of success.

Fixes 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")

---
I copy and pasted this approach from similar code in the same patch.

 drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +3 -1
index 1464aad039e1..f2e952481ff8 100644
@@ -707,8 +707,10 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			rcu_dereference_protected(mvm_sta->link[link_id],
 						  lockdep_is_held(&mvm->mutex));
 
-		if (WARN_ON(!link_conf || !mvm_link_sta))
+		if (WARN_ON(!link_conf || !mvm_link_sta)) {
+			ret = -EINVAL;
 			goto err;
+		}
 
 		ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
 					  mvm_link_sta);
Signature · 1 line
2.39.2
#1 lore raw

Ping?

regards,
dan carpenter

Quoted 28 lines · Dan Carpenter

This error path should return -EINVAL instead of success.

Fixes 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")

---
I copy and pasted this approach from similar code in the same patch.

 drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +3 -1
index 1464aad039e1..f2e952481ff8 100644
@@ -707,8 +707,10 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			rcu_dereference_protected(mvm_sta->link[link_id],
 						  lockdep_is_held(&mvm->mutex));
 
-		if (WARN_ON(!link_conf || !mvm_link_sta))
+		if (WARN_ON(!link_conf || !mvm_link_sta)) {
+			ret = -EINVAL;
 			goto err;
+		}
 
 		ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
 					  mvm_link_sta);
Signature · 1 line
2.39.2
#2 lore raw

Hi

Sorry for the delay,
I am fixing it.

Thanks,
Miri

Miri Korenblit | CCG | WCS | WCD
Office: +972 2 589-7724 | Cell Phone: +972 54 846 3803

-----Original Message-----
From: Dan Carpenter <[email protected]>
Sent: Thursday, October 26, 2023 13:42
To: Greenman, Gregory <[email protected]>
Cc: Kalle Valo <[email protected]>; Berg, Johannes <[email protected]>; Korenblit, Miriam Rachel <[email protected]>; Triebitz, Shaul <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()

Ping?

regards,
dan carpenter

Quoted 28 lines · Dan Carpenter

This error path should return -EINVAL instead of success.

Fixes 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")

---
I copy and pasted this approach from similar code in the same patch.

 drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +3 -1
index 1464aad039e1..f2e952481ff8 100644
@@ -707,8 +707,10 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			rcu_dereference_protected(mvm_sta->link[link_id],
 						  lockdep_is_held(&mvm->mutex));
 
-		if (WARN_ON(!link_conf || !mvm_link_sta))
+		if (WARN_ON(!link_conf || !mvm_link_sta)) {
+			ret = -EINVAL;
 			goto err;
+		}
 
 		ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
 					  mvm_link_sta);
Signature · 1 line
2.39.2

---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#3 lore raw
In reply to Dan Carpenter
Quoted 26 lines · Dan Carpenter

Ping?

regards,
dan carpenter

Quoted 20 lines · Dan Carpenter

This error path should return -EINVAL instead of success.

Fixes 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")

---
I copy and pasted this approach from similar code in the same patch.

 drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +0 -0
index 1464aad039e1..f2e952481ff8 100644
@@ -707,8 +707,10 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                         rcu_dereference_protected(mvm_sta->link[link_id],
                                                   lockdep_is_held(&mvm->mutex));

-               if (WARN_ON(!link_conf || !mvm_link_sta))
+               if (WARN_ON(!link_conf || !mvm_link_sta)) {
Quoted 8 lines
Quoted 8 lines

+                       ret = -EINVAL;
                        goto err;
+               }

                ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf, mvm_link_sta);

Signature · 1 line
2.39.2

Thanks for the fix.