Commit 0ea03f79 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: r8188eu: Fix a couple scheduling in atomic bugs

These allocations are sometimes done while holding a spin_lock so they
have to be atomic.  The call tree looks like this:

-> rtw_set_802_11_connect() <- takes a spin_lock
   -> rtw_do_join()
      -> rtw_sitesurvey_cmd()  <-- does a GFP_ATOMIC allocation
         -> p2p_ps_wk_cmd()

Fixes: 15865124 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210812065710.GA31863@kiliSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d5e4bfe
...@@ -1697,13 +1697,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue) ...@@ -1697,13 +1697,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
return res; return res;
if (enqueue) { if (enqueue) {
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (!ph2c) { if (!ph2c) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC);
if (!pdrvextra_cmd_parm) { if (!pdrvextra_cmd_parm) {
kfree(ph2c); kfree(ph2c);
res = _FAIL; res = _FAIL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment