Skip to content

Commit 0e90ad9

Browse files
Shahed Shaikhdavem330
authored andcommitted
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>
1 parent da286a6 commit 0e90ad9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
13841384
size_t size;
13851385
u64 addr;
13861386

1387-
temp = kzalloc(fw->size, GFP_KERNEL);
1387+
temp = vzalloc(fw->size);
13881388
if (!temp) {
13891389
release_firmware(fw);
13901390
fw_info->fw = NULL;
@@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
14301430
exit:
14311431
release_firmware(fw);
14321432
fw_info->fw = NULL;
1433-
kfree(temp);
1433+
vfree(temp);
14341434

14351435
return ret;
14361436
}

0 commit comments

Comments
 (0)