RE: [patch] mwifiex: usb: return an error if kmalloc fails

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

 



Hi Dan,

> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Tuesday, August 04, 2015 1:19 PM
> To: Amitkumar Karwar
> Cc: Nishant Sarmukadam; Kalle Valo; linux-wireless@xxxxxxxxxxxxxxx;
> kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [patch] mwifiex: usb: return an error if kmalloc fails
> 
> The current code returns success if kmalloc fails.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/net/wireless/mwifiex/usb.c
> b/drivers/net/wireless/mwifiex/usb.c
> index fbad99c..f866d5d 100644
> --- a/drivers/net/wireless/mwifiex/usb.c
> +++ b/drivers/net/wireless/mwifiex/usb.c
> @@ -870,8 +870,10 @@ static int mwifiex_prog_fw_w_helper(struct
> mwifiex_adapter *adapter,
> 
>  	/* Allocate memory for transmit */
>  	fwdata = kzalloc(FW_DNLD_TX_BUF_SIZE, GFP_KERNEL);
> -	if (!fwdata)
> +	if (!fwdata) {
> +		ret = -ENOMEM;
>  		goto fw_exit;
> +	}
> 
>  	/* Allocate memory for receive */
>  	recv_buff = kzalloc(FW_DNLD_RX_BUF_SIZE, GFP_KERNEL);

Acked-by: Amitkumar Karwar <akarwar@xxxxxxxxxxx>

Regards,
Amitkumar
--
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



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux