Skip to content

Commit

Permalink
ice: fix memory allocation call
Browse files Browse the repository at this point in the history
commit 59df14f upstream.

Fix the order of number of array members and member size parameters in a
*calloc() call.

Fixes: b3c3890 ("ice: avoid unnecessary single-member variable-length structs")
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bwallan authored and gregkh committed Apr 14, 2021
1 parent 4686a26 commit 286830a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_common.c
Expand Up @@ -717,8 +717,8 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)

if (!data) {
data = devm_kcalloc(ice_hw_to_dev(hw),
sizeof(*data),
ICE_AQC_FW_LOG_ID_MAX,
sizeof(*data),
GFP_KERNEL);
if (!data)
return ICE_ERR_NO_MEMORY;
Expand Down

0 comments on commit 286830a

Please sign in to comment.