summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2017-10-08 14:54:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 12:07:33 +0300
commit8315bcf841ae26d266dbaecd8a47956632478799 (patch)
tree384ece7d8af7fed098098ace0187cd677aaeb945 /drivers/staging
parent6641d3e307f5b42237a99f2aa961051a71c50393 (diff)
downloadlinux-8315bcf841ae26d266dbaecd8a47956632478799.tar.xz
rtl8188eu: Fix a possible sleep-in-atomic bug in rtw_disassoc_cmd
[ Upstream commit 08880f8e08cbd814e870e9d3ab9530abc1bce226 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-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 318d5b002272..6051a7ba0797 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -522,7 +522,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);