Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()
@ 2023-09-27 12:40 Dan Carpenter
  2023-10-26 10:42 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2023-09-27 12:40 UTC (permalink / raw)
  To: Gregory Greenman
  Cc: Kalle Valo, Johannes Berg, Miri Korenblit, Shaul Triebitz,
	linux-wireless, kernel-janitors

This error path should return -EINVAL instead of success.

Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
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(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
index 1464aad039e1..f2e952481ff8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
@@ -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);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-26 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 12:40 [PATCH] wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() Dan Carpenter
2023-10-26 10:42 ` Dan Carpenter
2023-10-26 10:44   ` Korenblit, Miriam Rachel
2023-10-26 14:09   ` Greenman, Gregory

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox