Skip to content

Commit

Permalink
ice: Remove managed memory usage in ice_get_fw_log_cfg()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and Tony Nguyen committed Jun 22, 2023
1 parent ad667d6 commit 1dacc49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
u16 size;

size = sizeof(*config) * ICE_AQC_FW_LOG_ID_MAX;
config = devm_kzalloc(ice_hw_to_dev(hw), size, GFP_KERNEL);
config = kzalloc(size, GFP_KERNEL);
if (!config)
return -ENOMEM;

Expand All @@ -856,7 +856,7 @@ static int ice_get_fw_log_cfg(struct ice_hw *hw)
}
}

devm_kfree(ice_hw_to_dev(hw), config);
kfree(config);

return status;
}
Expand Down

0 comments on commit 1dacc49

Please sign in to comment.