* [PATCH] staging: r8188eu: Fix a couple scheduling in atomic bugs
@ 2021-08-12 6:57 Dan Carpenter
2021-08-12 13:32 ` Larry Finger
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-12 6:57 UTC (permalink / raw)
To: Larry Finger
Cc: Phillip Potter, Greg Kroah-Hartman, Michael Straube,
linux-staging, kernel-janitors
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: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/r8188eu/core/rtw_p2p.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c
index b4497444a7af..04480a86902e 100644
--- a/drivers/staging/r8188eu/core/rtw_p2p.c
+++ b/drivers/staging/r8188eu/core/rtw_p2p.c
@@ -1697,13 +1697,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
return res;
if (enqueue) {
- ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
+ ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
if (!ph2c) {
res = _FAIL;
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) {
kfree(ph2c);
res = _FAIL;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: r8188eu: Fix a couple scheduling in atomic bugs
2021-08-12 6:57 [PATCH] staging: r8188eu: Fix a couple scheduling in atomic bugs Dan Carpenter
@ 2021-08-12 13:32 ` Larry Finger
0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2021-08-12 13:32 UTC (permalink / raw)
To: Dan Carpenter
Cc: Phillip Potter, Greg Kroah-Hartman, Michael Straube,
linux-staging, kernel-janitors
On 8/12/21 1:57 AM, Dan Carpenter wrote:
> 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: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/staging/r8188eu/core/rtw_p2p.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c
> index b4497444a7af..04480a86902e 100644
> --- a/drivers/staging/r8188eu/core/rtw_p2p.c
> +++ b/drivers/staging/r8188eu/core/rtw_p2p.c
> @@ -1697,13 +1697,13 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
> return res;
>
> if (enqueue) {
> - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL);
> + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
> if (!ph2c) {
> res = _FAIL;
> 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) {
> kfree(ph2c);
> res = _FAIL;
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Thanks,
Larry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-12 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12 6:57 [PATCH] staging: r8188eu: Fix a couple scheduling in atomic bugs Dan Carpenter
2021-08-12 13:32 ` Larry Finger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox