From: Johannes Berg Date: Wed, 5 Dec 2012 08:49:14 +0000 (+0100) Subject: mac80211: cancel work instead of waiting for it to do nothing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0b7dff4faed07f55be2a98dd0eafc02623174236;p=openwrt%2Fstaging%2Fblogic.git mac80211: cancel work instead of waiting for it to do nothing If the sdata work is pending while the interface is stopped, we currently flush it. If it's not running this means waiting for it to run, which could take a while if the workqueue is backlogged. However, the work exits right away if it starts to run while the interface is already stopping. There's no point in waiting for that, so use cancel_work_sync() instead. Reported-by: Ben Greear Tested-by: Ben Greear Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 40c36d5d7377..09a80b55cf5a 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -862,7 +862,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, rcu_assign_pointer(local->p2p_sdata, NULL); /* fall through */ default: - flush_work(&sdata->work); + cancel_work_sync(&sdata->work); /* * When we get here, the interface is marked down. * Call rcu_barrier() to wait both for the RX path