From: Dan Carpenter Date: Wed, 27 Sep 2023 12:40:41 +0000 (+0300) Subject: wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() X-Git-Tag: v6.6.17~2318 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf3b66ecf48a752c96cf7c03c25199497df61b3d;p=platform%2Fkernel%2Flinux-rpi.git wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() [ Upstream commit 71b5e40651d89a8685bea1592dfcd2aa61559628 ] 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 Acked-by: Gregory Greenman Link: https://lore.kernel.org/r/75e4ea09-db58-462f-bd4e-5ad4e5e5dcb5@moroto.mountain Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 56f51344c193..1ccbe8c1eeb4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -705,8 +705,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);