staging: r8188eu: Use GFP_ATOMIC under spin lock

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.

Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210810125314.2182112-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yang Yingliang 2021-08-10 20:53:14 +08:00 committed by Greg Kroah-Hartman
parent dcda94c941
commit e3027f25c6
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;