Commit 356ae2a1 authored by Martin Kaistra's avatar Martin Kaistra Committed by Guo Mengqi
Browse files

wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work

stable inclusion
from stable-v5.10.214
commit dddedfa3b29a63c2ca4336663806a6128b8545b4
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9L9M3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dddedfa3b29a63c2ca4336663806a6128b8545b4



--------------------------------

[ Upstream commit 1213acb478a7181cd73eeaf00db430f1e45b1361 ]

The workqueue might still be running, when the driver is stopped. To
avoid a use-after-free, call cancel_work_sync() in rtl8xxxu_stop().

Fixes: e542e66b ("rtl8xxxu: add bluetooth co-existence support for single antenna")
Signed-off-by: default avatarMartin Kaistra <martin.kaistra@linutronix.de>
Reviewed-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240111163628.320697-2-martin.kaistra@linutronix.de


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
parent ccd2a609
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6494,6 +6494,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)
	if (priv->usb_interrupts)
		rtl8xxxu_write32(priv, REG_USB_HIMR, 0);

	cancel_work_sync(&priv->c2hcmd_work);
	cancel_delayed_work_sync(&priv->ra_watchdog);

	rtl8xxxu_free_rx_resources(priv);