Skip to content
Commit a40c973e authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192u: Replace GFP_ATOMIC with GFP_KERNEL in ieee80211_softmac_init



ieee80211_softmac_init() is never called in atomic context.

The call chains ending up at ieee80211_softmac_init() is:
[1] ieee80211_softmac_init() <- alloc_ieee80211_rsl() <-
    rtl8192_usb_probe()

rtl8192_usb_probe() is set as ".probe" in struct usb_driver.

Despite never getting called from atomic context,
ieee80211_softmac_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: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a626c4fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment