]> git.itanic.dy.fi Git - linux-stable/commitdiff
wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 27 Sep 2023 12:40:41 +0000 (15:40 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Nov 2023 17:23:15 +0000 (18:23 +0100)
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>
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/75e4ea09-db58-462f-bd4e-5ad4e5e5dcb5@moroto.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

index ca5e4fbcf8ce53108448b4fe338658e04b820398..6af606e5da657ed5d860f7cf67726424480ce595 100644 (file)
@@ -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);