From: Shahed Shaikh Date: Fri, 7 Aug 2015 11:17:06 +0000 (-0400) Subject: qlcnic: Don't use kzalloc unncecessarily for allocating large chunk of memory X-Git-Tag: v4.3-rc1~96^2~204^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e90ad9bfdcc8835945ccb49f39c21ff3cb0b785;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index 753ea8b..bf89216 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c @@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter) size_t size; u64 addr; - temp = kzalloc(fw->size, GFP_KERNEL); + temp = vzalloc(fw->size); if (!temp) { release_firmware(fw); fw_info->fw = NULL; @@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter) exit: release_firmware(fw); fw_info->fw = NULL; - kfree(temp); + vfree(temp); return ret; }