linux-wireless.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

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