Johannes Berg wrote: > Yeah you're right. > > However, when the interface is deleted, the driver must still also > remove the scan and definitely schedule the work, so most drivers will > really always do so in cancel_hw_scan()? We could change the API and > require that to be synchronous, like in the interface removal case, but > maybe we don't want to. > > How about this then? > > diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c > index e469b3390f2a..6f1b90eb568c 100644 > --- a/net/mac80211/iface.c > +++ b/net/mac80211/iface.c > @@ -766,10 +766,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, > int i, flushed; > struct ps_data *ps; > struct cfg80211_chan_def chandef; > + bool cancel_scan; > > clear_bit(SDATA_STATE_RUNNING, &sdata->state); > > - if (rcu_access_pointer(local->scan_sdata) == sdata) > + cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; > + if (cancel_scan) > ieee80211_scan_cancel(local); > > /* > @@ -993,6 +995,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, > > ieee80211_recalc_ps(local, -1); > > + if (cancel_scan) > + flush_delayed_work(&local->scan_work); > + > if (local->open_count == 0) { > ieee80211_stop_device(local); Yep, this fixes the issue. Thanks ! Sujith -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html