瀏覽代碼

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>
Dan Carpenter 10 年之前
父節點
當前提交
3b1f0e8695
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/net/wireless/mwifiex/usb.c

+ 3 - 1
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);