[PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
From: Gongwei Li
Date: Tue Sep 29 2026 - 21:52:43 EST
From: Gongwei Li <ligongwei@xxxxxxxxxx>
rtw_scan_abort() checks jiffies_to_msecs(start) <= 200, but start holds
an absolute jiffies value, so this converts the time since boot rather
than the elapsed time. Once the system has been up for more than 200ms
the condition is always false and the loop never waits for an ongoing
scan to finish.
Use jiffies_to_msecs(jiffies - start) to get the real elapsed time.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Gongwei Li <ligongwei@xxxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index d18768a51b19..d4beff59f272 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -931,7 +931,7 @@ void rtw_scan_abort(struct adapter *adapter)
start = jiffies;
pmlmeext->scan_abort = true;
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
- && jiffies_to_msecs(start) <= 200) {
+ && jiffies_to_msecs(jiffies - start) <= 200) {
if (adapter->driver_stopped || adapter->bSurpriseRemoved)
break;
--
2.25.1