Skip to content

Commit 1dacc49

Browse files
tititiou36anguy11
authored andcommitted
ice: Remove managed memory usage in ice_get_fw_log_cfg()
There is no need to use managed memory allocation here. The memory is released at the end of the function. Use kzalloc()/kfree() to simplify the code. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent ad667d6 commit 1dacc49

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
833833
u16 size;
834834

835835
size = sizeof(*config) * ICE_AQC_FW_LOG_ID_MAX;
836-
config = devm_kzalloc(ice_hw_to_dev(hw), size, GFP_KERNEL);
836+
config = kzalloc(size, GFP_KERNEL);
837837
if (!config)
838838
return -ENOMEM;
839839

@@ -856,7 +856,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
856856
}
857857
}
858858

859-
devm_kfree(ice_hw_to_dev(hw), config);
859+
kfree(config);
860860

861861
return status;
862862
}

0 commit comments

Comments
 (0)