kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mwifiex: usb: return an error if kmalloc fails
@ 2015-08-04  7:49 Dan Carpenter
  2015-08-05 13:27 ` Amitkumar Karwar
  2015-08-13 12:33 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-08-04  7:49 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: Nishant Sarmukadam, Kalle Valo, linux-wireless, kernel-janitors

The current code returns success if kmalloc fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [patch] mwifiex: usb: return an error if kmalloc fails
  2015-08-04  7:49 [patch] mwifiex: usb: return an error if kmalloc fails Dan Carpenter
@ 2015-08-05 13:27 ` Amitkumar Karwar
  2015-08-13 12:33 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Amitkumar Karwar @ 2015-08-05 13:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nishant Sarmukadam, Kalle Valo, linux-wireless, kernel-janitors

Hi Dan,

> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Tuesday, August 04, 2015 1:19 PM
> To: Amitkumar Karwar
> Cc: Nishant Sarmukadam; Kalle Valo; linux-wireless@vger.kernel.org;
> kernel-janitors@vger.kernel.org
> 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@oracle.com>
> 
> 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@marvell.com>

Regards,
Amitkumar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mwifiex: usb: return an error if kmalloc fails
  2015-08-04  7:49 [patch] mwifiex: usb: return an error if kmalloc fails Dan Carpenter
  2015-08-05 13:27 ` Amitkumar Karwar
@ 2015-08-13 12:33 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2015-08-13 12:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Amitkumar Karwar, Nishant Sarmukadam, linux-wireless, kernel-janitors


> The current code returns success if kmalloc fails.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Amitkumar Karwar <akarwar@marvell.com>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-13 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04  7:49 [patch] mwifiex: usb: return an error if kmalloc fails Dan Carpenter
2015-08-05 13:27 ` Amitkumar Karwar
2015-08-13 12:33 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).