Merge tag 'v3.10.13' into lsk/v3.10/topic/kvm
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / iface.c
index 98d20c0f6fed8829c1881e16b274c2bf97c589c4..514e90f470bf654abf6f6279cf8dbc16284e0ef9 100644 (file)
@@ -1717,6 +1717,15 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
 
        ASSERT_RTNL();
 
+       /*
+        * Close all AP_VLAN interfaces first, as otherwise they
+        * might be closed while the AP interface they belong to
+        * is closed, causing unregister_netdevice_many() to crash.
+        */
+       list_for_each_entry(sdata, &local->interfaces, list)
+               if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+                       dev_close(sdata->dev);
+
        /*
         * Close all AP_VLAN interfaces first, as otherwise they
         * might be closed while the AP interface they belong to