Skip to contentSkip to conversation

ice: fix error return code in ice_get_recp_frm_fw()

PATCH New Wang Hai 1 participant 1 message Oct 26, 2021

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 ice: fix error return code in ice_get_recp_frm_fw()

Return error code if devm_kmemdup() fails in ice_get_recp_frm_fw()

Fixes fd2a6b71e300 ("ice: create advanced switch recipe")
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_switch.c +3 -1
index 2742e1c1e33..373bcb5e4f4 100644
@@ -1177,8 +1177,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);
Signature · 1 line
2.17.1