]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mwifiex: usb: return an error if kmalloc fails
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 4 Aug 2015 07:49:27 +0000 (10:49 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Aug 2015 12:33:25 +0000 (15:33 +0300)
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>
drivers/net/wireless/mwifiex/usb.c

index fbad99c503078ab9e2e840da438892a2067e92aa..f866d5da222b1ae69dce88bec5d1f606b3380d01 100644 (file)
@@ -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);