diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-08-04 10:49:27 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-08-13 15:33:25 +0300 |
commit | 3b1f0e86958b8afcfb6980f987c41e149480f9bd (patch) | |
tree | dce81ca73b01c2603d2945750714b1b69cc8cb46 /drivers/net/wireless | |
parent | 3544f9f150bb58a3678c161a505b186893971c8a (diff) | |
download | op-kernel-dev-3b1f0e86958b8afcfb6980f987c41e149480f9bd.zip op-kernel-dev-3b1f0e86958b8afcfb6980f987c41e149480f9bd.tar.gz |
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>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mwifiex/usb.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |