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.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Kumar Amit Mehta 2015-01-26 16:39:14 +01:00 committed by Greg Kroah-Hartman
parent 1007c69226
commit 0137f1a019
1 changed files with 2 additions and 0 deletions

View File

@ -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;