linux/drivers/staging/rtl8192u
Jia-Ju Bai 98743f8749 staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_ccmp_init
ieee80211_ccmp_init() is never called in atomic context.

ieee80211_ccmp_init() is only set as ".init" in
struct ieee80211_crypto_ops.
The call chains ending up at "->init" function are:
[1] ->init() <- ieee80211_wpa_set_encryption() <-
	ieee80211_wpa_supplicant_ioctl()
[2] ->init() <- ieee80211_wx_set_encode_ext_rsl() <-
	r8192_wx_set_enc_ext()
[3] ->init() <- ieee80211_wx_set_encode_rsl() <-
	r8192_wx_set_enc()

ieee80211_wpa_supplicant_ioctl(), r8192_wx_set_enc_ext() and
r8192_wx_set_enc() call mutex_lock(), which indicates these functions
are not called in atomic context.

Despite never getting called from atomic context,
ieee80211_ccmp_init() calls kzalloc() with GFP_ATOMIC,
which does not sleep for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23 15:51:34 +02:00
..
ieee80211 staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_ccmp_init 2018-04-23 15:51:34 +02:00
authors
changes
copying
Kconfig Staging: rtl8192u: kconfig: Remove blank help text 2018-02-02 23:53:10 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_cmdpkt.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_cmdpkt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_firmware_img.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_firmware_img.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_firmware.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_firmware.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_phy.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_phy.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r819xU_phyreg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
r8180_93cx6.c
r8180_93cx6.h
r8190_rtl8256.c
r8190_rtl8256.h
r8192U_core.c staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr 2018-03-01 17:26:13 +01:00
r8192U_dm.c Staging/IIO patches for 4.15-rc1 2017-11-13 20:53:28 -08:00
r8192U_dm.h Staging/IIO patches for 4.15-rc1 2017-11-13 20:53:28 -08:00
r8192U_hw.h staging: rtl8192u: Fix braces placement and spacing 2017-07-16 08:41:02 +02:00
r8192U_wx.c staging: rtl8192u: make r8192_wx_handlers_def structure const 2017-10-03 18:34:57 +02:00
r8192U_wx.h staging: rtl8192u: make r8192_wx_handlers_def structure const 2017-10-03 18:34:57 +02:00
r8192U.h