mwifiex: missing error code on allocation failure
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 19 Apr 2016 14:21:58 +0000 (07:21 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 26 Apr 2016 09:28:53 +0000 (12:28 +0300)
We accidentally return success instead of -ENOMEM.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/usb.c

index 0510861..cdd8f9a 100644 (file)
@@ -1017,8 +1017,10 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
 
        /* Allocate memory for receive */
        recv_buff = kzalloc(FW_DNLD_RX_BUF_SIZE, GFP_KERNEL);
-       if (!recv_buff)
+       if (!recv_buff) {
+               ret = -ENOMEM;
                goto cleanup;
+       }
 
        do {
                /* Send pseudo data to check winner status first */