rtl8192_usb_disconnect() is never called in atomic context.

rtl8192_usb_disconnect() is only set as ".disconnect" in 
struct usb_driver.

Despite never getting called from atomic context, 
rtl8192_usb_disconnect() calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() to
avoid busy waiting.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

Signed-off-by: Jia-Ju Bai <baijiaju1...@gmail.com>
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
index 46b3f19..04ed34a 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -5033,7 +5033,7 @@ static void rtl8192_usb_disconnect(struct usb_interface 
                priv->pFirmware = NULL;
-               mdelay(10);
+               usleep_range(10000, 11000);
        RT_TRACE(COMP_DOWN, "wlan driver removed\n");

Reply via email to