[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d3356688-98e9-ddaf-592b-751a753a8f4a@lwfinger.net>
Date: Tue, 10 Aug 2021 10:15:36 -0500
From: Larry Finger <Larry.Finger@...inger.net>
To: Yang Yingliang <yangyingliang@...wei.com>,
linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev
Cc: phil@...lpotter.co.uk, gregkh@...uxfoundation.org
Subject: Re: [PATCH -next] staging: r8188eu: Use GFP_ATOMIC under spin lock
On 8/10/21 7:53 AM, Yang Yingliang wrote:
> A spin lock is taken in __nat25_db_network_insert() and
> update_BCNTIM() is called under spin lock so we should
> use GFP_ATOMIC in both place.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
> drivers/staging/r8188eu/core/rtw_ap.c | 2 +-
> drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_ap.c b/drivers/staging/r8188eu/core/rtw_ap.c
> index ad37f1f02ee2..0586e4a4cbcb 100644
> --- a/drivers/staging/r8188eu/core/rtw_ap.c
> +++ b/drivers/staging/r8188eu/core/rtw_ap.c
> @@ -98,7 +98,7 @@ static void update_BCNTIM(struct adapter *padapter)
> }
>
> if (remainder_ielen > 0) {
> - pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_KERNEL);
> + pbackup_remainder_ie = kmalloc(remainder_ielen, GFP_ATOMIC);
> if (pbackup_remainder_ie && premainder_ie)
> memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
> }
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 28f0452d6ccb..e3ff059ce224 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -394,7 +394,7 @@ static void __nat25_db_network_insert(struct adapter *priv,
> }
> db = db->next_hash;
> }
> - db = kmalloc(sizeof(*db), GFP_KERNEL);
> + db = kmalloc(sizeof(*db), GFP_ATOMIC);
> if (!db) {
> spin_unlock_bh(&priv->br_ext_lock);
> return;
>
Acked-by: Larry Finger <Larry.Finger@...inger.net>
Larry
Powered by blists - more mailing lists