Skip to content

Commit

Permalink
drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_joi…
Browse files Browse the repository at this point in the history
…n_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: 1586512 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Duoming Zhou <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
stonezdm authored and gregkh committed Nov 9, 2022
1 parent a614e75 commit ce8cc75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/core/rtw_pwrctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce8cc75

Please sign in to comment.