aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2017-10-08 19:54:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-18 15:43:35 +0200
commit08880f8e08cbd814e870e9d3ab9530abc1bce226 (patch)
tree4a01ab5dacc11412e229e71d75d346c96bc0213c /drivers/staging/rtl8188eu
parentstaging: rtl8188eu: add spaces around algebric and boolean operators (diff)
downloadlinux-dev-08880f8e08cbd814e870e9d3ab9530abc1bce226.tar.xz
linux-dev-08880f8e08cbd814e870e9d3ab9530abc1bce226.zip
rtl8188eu: Fix a possible sleep-in-atomic bug in rtw_disassoc_cmd
The driver may sleep under a spinlock, and the function call path is: rtw_set_802_11_bssid(acquire the spinlock) rtw_disassoc_cmd kzalloc(GFP_KERNEL) --> may sleep To fix it, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool and my code review. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 9461bce883ea..65083a72b408 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -508,7 +508,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
if (enqueue) {
/* need enqueue, prepare cmd_obj and enqueue */
- cmdobj = kzalloc(sizeof(*cmdobj), GFP_KERNEL);
+ cmdobj = kzalloc(sizeof(*cmdobj), GFP_ATOMIC);
if (!cmdobj) {
res = _FAIL;
kfree(param);