Re: [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 26 Jan 2015, Kumar Amit Mehta wrote:

> 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@xxxxxxxxx>
> ---
>  drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> index 3e9b6e9..a3ffc69 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> @@ -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

>  	subtype = GetFrameSubType(pframe) >> 4;
>
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux