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: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
da286a6fd1
commit
0e90ad9bfd
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
exit:
|
exit:
|
||||||
release_firmware(fw);
|
release_firmware(fw);
|
||||||
fw_info->fw = NULL;
|
fw_info->fw = NULL;
|
||||||
kfree(temp);
|
vfree(temp);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue