]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: reduce scope for uninitialized variable
authorYedidya Benshimol <yedidya.ben.shimol@intel.com>
Tue, 1 Apr 2025 03:45:54 +0000 (06:45 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 2 Apr 2025 08:39:28 +0000 (10:39 +0200)
After resuming from D3, keeping the connection or disconnecting
isn't relevant for the case of netdetect.
Reduce the scope of the keep_connection indicator to wowlan only.

Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver")
Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250401064530.769f76a9ad6e.I69e8f194997eb3a20e40d27fdc31002d5753d905@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/d3.c

index 5a7207accd8677076ca955c82fad9fa6aee17bd9..2c6e8ecd93b7ba1a3e3b08a88a28e71460fefac4 100644 (file)
@@ -1895,7 +1895,6 @@ int iwl_mld_wowlan_resume(struct iwl_mld *mld)
        int link_id;
        int ret;
        bool fw_err = false;
-       bool keep_connection;
 
        lockdep_assert_wiphy(mld->wiphy);
 
@@ -1965,7 +1964,7 @@ int iwl_mld_wowlan_resume(struct iwl_mld *mld)
                iwl_mld_process_netdetect_res(mld, bss_vif, &resume_data);
                mld->netdetect = false;
        } else {
-               keep_connection =
+               bool keep_connection =
                        iwl_mld_process_wowlan_status(mld, bss_vif,
                                                      resume_data.wowlan_status);
 
@@ -1973,11 +1972,10 @@ int iwl_mld_wowlan_resume(struct iwl_mld *mld)
                if (keep_connection)
                        iwl_mld_unblock_emlsr(mld, bss_vif,
                                              IWL_MLD_EMLSR_BLOCKED_WOWLAN);
+               else
+                       ieee80211_resume_disconnect(bss_vif);
        }
 
-       if (!mld->netdetect && !keep_connection)
-               ieee80211_resume_disconnect(bss_vif);
-
        goto out;
 
  err: