Skip to content

Commit

Permalink
ice: fix error return code in ice_get_recp_frm_fw()
Browse files Browse the repository at this point in the history
Return error code if devm_kmemdup() fails in ice_get_recp_frm_fw()

Fixes: fd2a6b7 ("ice: create advanced switch recipe")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Wang Hai authored and Tony Nguyen committed Oct 28, 2021
1 parent 370764e commit c8e51a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
recps[rid].root_buf = devm_kmemdup(ice_hw_to_dev(hw), tmp,
recps[rid].n_grp_count * sizeof(*recps[rid].root_buf),
GFP_KERNEL);
if (!recps[rid].root_buf)
if (!recps[rid].root_buf) {
status = ICE_ERR_NO_MEMORY;
goto err_unroll;
}

/* Copy result indexes */
bitmap_copy(recps[rid].res_idxs, result_bm, ICE_MAX_FV_WORDS);
Expand Down

0 comments on commit c8e51a0

Please sign in to comment.