提交 3b1f0e86 编写于 作者: D Dan Carpenter 提交者: Kalle Valo

mwifiex: usb: return an error if kmalloc fails

The current code returns success if kmalloc fails.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 3544f9f1
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册