aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/usb_intf.c
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-07-21 22:34:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-27 15:15:24 +0200
commit9be550ee43919b070bcd77f9228bdbbbc073245b (patch)
treef63643934000d8f130482e91eea36b90811428b8 /drivers/staging/rtl8712/usb_intf.c
parentstaging: rtl8723bs: select CONFIG_CRYPTO_LIB_ARC4 (diff)
downloadlinux-dev-9be550ee43919b070bcd77f9228bdbbbc073245b.tar.xz
linux-dev-9be550ee43919b070bcd77f9228bdbbbc073245b.zip
staging: rtl8712: get rid of flush_scheduled_work
This patch is preparation for following patch for error handling refactoring. flush_scheduled_work() takes (wq_completion)events lock and it can lead to deadlock when r871xu_dev_remove() is called from workqueue. To avoid deadlock sutiation we can change flush_scheduled_work() call to flush_work() call for all possibly scheduled works in this driver, since next patch adds device_release_driver() in case of fw load failure. Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/6e028b4c457eeb7156c76c6ea3cdb3cb0207c7e1.1626895918.git.paskripkin@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/usb_intf.c')
-rw-r--r--drivers/staging/rtl8712/usb_intf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index 2434b13c8b12..643f21eb1128 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -606,7 +606,8 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
padapter->surprise_removed = true;
if (pnetdev->reg_state != NETREG_UNINITIALIZED)
unregister_netdev(pnetdev); /* will call netdev_close() */
- flush_scheduled_work();
+ r8712_flush_rwctrl_works(padapter);
+ r8712_flush_led_works(padapter);
udelay(1);
/* Stop driver mlme relation timer */
r8712_stop_drv_timers(padapter);