From: Johannes Berg Date: Thu, 25 Jan 2024 08:51:09 +0000 (+0100) Subject: wifi: cfg80211: fix wiphy delayed work queueing X-Git-Tag: v6.6.18~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6585c74b4faa01eee1b7b5506f68c640a116d10c;p=thirdparty%2Fkernel%2Fstable.git wifi: cfg80211: fix wiphy delayed work queueing commit b743287d7a0007493f5cada34ed2085d475050b4 upstream. When a wiphy work is queued with timer, and then again without a delay, it's started immediately but *also* started again after the timer expires. This can lead, for example, to warnings in mac80211's offchannel code as reported by Jouni. Running the same work twice isn't expected, of course. Fix this by deleting the timer at this point, when queuing immediately due to delay=0. Cc: stable@vger.kernel.org Reported-by: Jouni Malinen Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics") Link: https://msgid.link/20240125095108.2feb0eaaa446.I4617f3210ed0e7f252290d5970dac6a876aa595b@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/wireless/core.c b/net/wireless/core.c index f6ada0a729778..ff743e1f2e2cb 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -1675,6 +1675,7 @@ void wiphy_delayed_work_queue(struct wiphy *wiphy, unsigned long delay) { if (!delay) { + del_timer(&dwork->timer); wiphy_work_queue(wiphy, &dwork->work); return; }