提交 0e90ad9b 编写于 作者: S Shahed Shaikh 提交者: David S. Miller

qlcnic: Don't use kzalloc unncecessarily for allocating large chunk of memory

Driver allocates a large chunk of temporary buffer using kzalloc
to copy FW image. As there is no real need of this memory to be
physically contiguous, use vzalloc instead.
Signed-off-by: NShahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 da286a6f
...@@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter) ...@@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
size_t size; size_t size;
u64 addr; u64 addr;
temp = kzalloc(fw->size, GFP_KERNEL); temp = vzalloc(fw->size);
if (!temp) { if (!temp) {
release_firmware(fw); release_firmware(fw);
fw_info->fw = NULL; fw_info->fw = NULL;
...@@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter) ...@@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
exit: exit:
release_firmware(fw); release_firmware(fw);
fw_info->fw = NULL; fw_info->fw = NULL;
kfree(temp); vfree(temp);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册