staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
Subsystems (2)
PATCH 1/1 staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
In rtw_check_bcn_info(), check the return value of kzalloc() before dereferencing it, to avoid NULL pointer dereference.
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +2 -0
@@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) } bssid =kzalloc (sizeof (struct wlan_bssid_ex ),GFP_ATOMIC ); +if (!bssid) +return _FAIL; subtype =GetFrameSubType (pframe) >>4 ;
Signature · 1 line
2.1.0
Quoted 13 lines · Kumar Amit Mehta
In
rtw_check_bcn_info(), check the return value ofkzalloc()before dereferencing it, to avoid NULL pointer dereference.Signed-off-by Kumar Amit Mehta <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/rtl8188eu/core/rtw_wlan_util.c +0
-0
drivers/staging/rtl8188eu/core/rtw_wlan_util.c int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · line 935
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +2
-0@@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) } bssid =kzalloc (sizeof (struct wlan_bssid_ex ),GFP_ATOMIC ); +if (!bssid) +return _FAIL;
I haven't looked at this issue in a while, but shouldn't this be OBD_ALLOC?
Although I still find macros parameters that are side effected to be unpleasant...
julia
Quoted 10 lines
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +0
-1subtype =GetFrameSubType (pframe) >>4 ; --2.1.0
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Julia Lawall
Quoted 15 lines · Kumar Amit Mehta
In
rtw_check_bcn_info(), check the return value ofkzalloc()before dereferencing it, to avoid NULL pointer dereference.Signed-off-by Kumar Amit Mehta <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/rtl8188eu/core/rtw_wlan_util.c +0
-0@@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) }
Quoted 6 lines
drivers/staging/rtl8188eu/core/rtw_wlan_util.c int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · line 935
Quoted 3 lines
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +2
-0bssid =kzalloc (sizeof (struct wlan_bssid_ex ),GFP_ATOMIC ); +if (!bssid) +return _FAIL;I haven't looked at this issue in a while, but shouldn't this be
OBD_ALLOC?
Sorry for the noise. I assumed that both patches were for lustre, but this one is not.
julia