If an interface is set down while authenticating or
associating, there's a station entry that will be
removed by the flushing in do_stop() and that will
cause a warning. It's otherwise harmless, but avoid
the warning by calling ieee80211_mgd_stop() first.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
 
        ieee80211_roc_purge(sdata);
 
+       if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               ieee80211_mgd_stop(sdata);
+
        /*
         * Remove all stations associated with this interface.
         *
                        }
                }
                spin_unlock_irqrestore(&ps->bc_buf.lock, flags);
-       } else if (sdata->vif.type == NL80211_IFTYPE_STATION) {
-               ieee80211_mgd_stop(sdata);
        }
 
        if (going_down)