staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
authorKumar Amit Mehta <gmate.amit@gmail.com>
Mon, 26 Jan 2015 15:39:14 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jan 2015 18:56:49 +0000 (10:56 -0800)
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>
drivers/staging/rtl8188eu/core/rtw_wlan_util.c

index 3e9b6e9..a3ffc69 100644 (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;