diff options
| author | Jia-Ju Bai <[email protected]> | 2018-04-10 20:23:54 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2018-04-23 15:51:34 +0200 |
| commit | a626c4fddd784a76b06573165f44b6bbba2d1808 (patch) | |
| tree | ad286b202cc490e6ecab7000b88f16ab9e648101 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 2accd50e15e35276d0ac5e365f75c3a2f514b20f (diff) | |
staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in prism2_wep_init
prism2_wep_init() is never called in atomic context.
prism2_wep_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,
prism2_wep_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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions