mwifiex: usb: return an error if kmalloc fails
Subsystems (2)
PATCH 1/1 mwifiex: usb: return an error if kmalloc fails
The current code returns success if kmalloc fails.
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/wireless/mwifiex/usb.c +3 -1
@@ -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 );
Hi Dan,
Quoted 28 lines
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 failsThe current code returns success if kmalloc fails.
Signed-off-by Dan Carpenter <[email protected]>drivers/net/wireless/mwifiex/usb.c +3
-1@@ -870,8 +870,10 @@ static int mwifiex_prog_fw_w_helper(structmwifiex_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 */
Quoted 1 line
recv_buff=kzalloc(FW_DNLD_RX_BUF_SIZE, GFP_KERNEL);
Acked-by Amitkumar Karwar <[email protected]>
Regards,
Amitkumar
Kalle Valo
AppliedQuoted 5 lines
The current code returns success if kmalloc fails.
Signed-off-by Dan Carpenter <[email protected]>Acked-by Amitkumar Karwar <[email protected]>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo