]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mld: iwl_mld_remove_link can't fail
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 12 Mar 2025 22:22:36 +0000 (00:22 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Mar 2025 09:27:33 +0000 (10:27 +0100)
iwl_mld_remove_link removes the link from both the FW and from the
driver.
If removing it from the FW failed, we assume that the FW is
dead anyway and remove it from the driver as well.
On the other hand, we still return an error value, indicating the caller
(i.e. mac80211) that the link couldn't be removed - while it was
actually removed.
Later, mac80211 might tell the driver again to remove that link,
and then the driver will warn that it doesn't exist.

Fix this by making iwl_mld_remove_link a void function.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250313002008.16fe6ebae412.If5371ff7e096b7078ff9e98ff0e72010cd1f076d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/link.c
drivers/net/wireless/intel/iwlwifi/mld/link.h
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c

index 6db8b53053490e8e050705dcf3757583062e8ad5..82a4979a3af3c90b7bb41eb8d5b3fe21d4e773c2 100644 (file)
@@ -455,7 +455,7 @@ void iwl_mld_deactivate_link(struct iwl_mld *mld,
                                               mld_link->fw_id);
 }
 
-static int
+static void
 iwl_mld_rm_link_from_fw(struct iwl_mld *mld, struct ieee80211_bss_conf *link)
 {
        struct iwl_mld_link *mld_link = iwl_mld_link_from_mac80211(link);
@@ -464,13 +464,13 @@ iwl_mld_rm_link_from_fw(struct iwl_mld *mld, struct ieee80211_bss_conf *link)
        lockdep_assert_wiphy(mld->wiphy);
 
        if (WARN_ON(!mld_link))
-               return -EINVAL;
+               return;
 
        cmd.link_id = cpu_to_le32(mld_link->fw_id);
        cmd.spec_link_id = link->link_id;
        cmd.phy_id = cpu_to_le32(FW_CTXT_ID_INVALID);
 
-       return iwl_mld_send_link_cmd(mld, &cmd, FW_CTXT_ACTION_REMOVE);
+       iwl_mld_send_link_cmd(mld, &cmd, FW_CTXT_ACTION_REMOVE);
 }
 
 static void iwl_mld_omi_bw_update(struct iwl_mld *mld,
@@ -832,18 +832,17 @@ free:
 }
 
 /* Remove link from fw, unmap the bss_conf, and destroy the link structure */
-int iwl_mld_remove_link(struct iwl_mld *mld,
-                       struct ieee80211_bss_conf *bss_conf)
+void iwl_mld_remove_link(struct iwl_mld *mld,
+                        struct ieee80211_bss_conf *bss_conf)
 {
        struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(bss_conf->vif);
        struct iwl_mld_link *link = iwl_mld_link_from_mac80211(bss_conf);
        bool is_deflink = link == &mld_vif->deflink;
-       int ret;
 
        if (WARN_ON(!link || link->active))
-               return -EINVAL;
+               return;
 
-       ret = iwl_mld_rm_link_from_fw(mld, bss_conf);
+       iwl_mld_rm_link_from_fw(mld, bss_conf);
        /* Continue cleanup on failure */
 
        if (!is_deflink)
@@ -854,11 +853,9 @@ int iwl_mld_remove_link(struct iwl_mld *mld,
        wiphy_delayed_work_cancel(mld->wiphy, &link->rx_omi.finished_work);
 
        if (WARN_ON(link->fw_id >= mld->fw->ucode_capa.num_links))
-               return -EINVAL;
+               return;
 
        RCU_INIT_POINTER(mld->fw_id_to_bss_conf[link->fw_id], NULL);
-
-       return ret;
 }
 
 void iwl_mld_handle_missed_beacon_notif(struct iwl_mld *mld,
index 3a4f3ac990d7e5f1240a9e7f5ffa6cae4fc0065e..42b7bdcbd741210f0943107f7da04e8736e47f0d 100644 (file)
@@ -114,8 +114,8 @@ iwl_mld_cleanup_link(struct iwl_mld *mld, struct iwl_mld_link *link)
 
 int iwl_mld_add_link(struct iwl_mld *mld,
                     struct ieee80211_bss_conf *bss_conf);
-int iwl_mld_remove_link(struct iwl_mld *mld,
-                       struct ieee80211_bss_conf *bss_conf);
+void iwl_mld_remove_link(struct iwl_mld *mld,
+                        struct ieee80211_bss_conf *bss_conf);
 int iwl_mld_activate_link(struct iwl_mld *mld,
                          struct ieee80211_bss_conf *link);
 void iwl_mld_deactivate_link(struct iwl_mld *mld,
index 938cf5900a29587125f5b7c3809b523c9bb50eff..6851064b82da1878029156d69c924c55ebfc4e48 100644 (file)
@@ -2456,13 +2456,8 @@ iwl_mld_change_vif_links(struct ieee80211_hw *hw,
                added |= BIT(0);
 
        for (int i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
-               if (removed & BIT(i)) {
-                       link_conf = old[i];
-
-                       err = iwl_mld_remove_link(mld, link_conf);
-                       if (err)
-                               return err;
-               }
+               if (removed & BIT(i))
+                       iwl_mld_remove_link(mld, old[i]);
        }
 
        for (int i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {