Hi Dan,

> From: Dan Carpenter [mailto:[email protected]]
> Sent: Tuesday, August 04, 2015 1:19 PM
> To: Amitkumar Karwar
> Cc: Nishant Sarmukadam; Kalle Valo; [email protected];
> [email protected]
> Subject: [patch] mwifiex: usb: return an error if kmalloc fails
> 
> The current code returns success if kmalloc fails.
> 
> Signed-off-by: Dan Carpenter <[email protected]>
> 
> 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 <[email protected]>

Regards,
Amitkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to