[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221018083424.79741-1-duoming@zju.edu.cn>
Date: Tue, 18 Oct 2022 16:34:24 +0800
From: Duoming Zhou <duoming@....edu.cn>
To: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Cc: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
paskripkin@...il.com, gregkh@...uxfoundation.org, martin@...ser.cx,
straube.linux@...il.com, kuba@...nel.org,
Duoming Zhou <duoming@....edu.cn>
Subject: [PATCH] drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler
The rtw_join_timeout_handler() is a timer handler that
runs in atomic context, but it could call msleep().
As a result, the sleep-in-atomic-context bug will happen.
The process is shown below:
(atomic context)
rtw_join_timeout_handler
_rtw_join_timeout_handler
rtw_do_join
rtw_select_and_join_from_scanned_queue
rtw_indicate_disconnect
rtw_lps_ctrl_wk_cmd
lps_ctrl_wk_hdl
LPS_Leave
LPS_RF_ON_check
msleep //sleep in atomic context
Fix by removing msleep() and replacing with mdelay().
Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Duoming Zhou <duoming@....edu.cn>
---
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 870d81735b8..5290ac36f08 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -273,7 +273,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
err = -1;
break;
}
- msleep(1);
+ mdelay(1);
}
return err;
--
2.17.1
Powered by blists - more mailing lists