Merge tag 'devicetree-fixes-for-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / net / mac80211 / main.c
index 1b9c826..62145e5 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright (C) 2017     Intel Deutschland GmbH
- * Copyright (C) 2018 - 2019 Intel Corporation
+ * Copyright (C) 2018-2021 Intel Corporation
  */
 
 #include <net/mac80211.h>
@@ -282,6 +282,13 @@ static void ieee80211_restart_work(struct work_struct *work)
                         * Then we can have a race...
                         */
                        cancel_work_sync(&sdata->u.mgd.csa_connection_drop_work);
+                       if (sdata->vif.csa_active) {
+                               sdata_lock(sdata);
+                               ieee80211_sta_connection_lost(sdata,
+                                                             sdata->u.mgd.associated->bssid,
+                                                             WLAN_REASON_UNSPECIFIED, false);
+                               sdata_unlock(sdata);
+                       }
                }
                flush_delayed_work(&sdata->dec_tailroom_needed_wk);
        }
@@ -1141,8 +1148,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        if (local->hw.wiphy->max_scan_ie_len)
                local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len;
 
-       WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes,
-                                        local->hw.n_cipher_schemes));
+       if (WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes,
+                                            local->hw.n_cipher_schemes))) {
+               result = -EINVAL;
+               goto fail_workqueue;
+       }
 
        result = ieee80211_init_cipher_suites(local);
        if (result < 0)