Commit ec89032c authored by Reto Schneider's avatar Reto Schneider Committed by Kalle Valo

rtlwifi: rtl8192cu: Fix deadlock

Prevent code from calling itself indirectly, causing the driver to hang
and consume 100% CPU.

Without this fix, the following script can bring down a single CPU
system:
```
while true; do
  rmmod rtl8192cu
  modprobe rtl8192cu
done
```
Signed-off-by: default avatarReto Schneider <code@reto-schneider.ch>
ACKed-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200622132113.14508-2-code@reto-schneider.ch
parent f8279dad
......@@ -680,8 +680,10 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw)
tasklet_kill(&rtlusb->rx_work_tasklet);
cancel_work_sync(&rtlpriv->works.lps_change_work);
flush_workqueue(rtlpriv->works.rtl_wq);
destroy_workqueue(rtlpriv->works.rtl_wq);
if (rtlpriv->works.rtl_wq) {
destroy_workqueue(rtlpriv->works.rtl_wq);
rtlpriv->works.rtl_wq = NULL;
}
skb_queue_purge(&rtlusb->rx_queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment