[PATCH v3 019/129] net/ice/base: improve find recipe routine

Anatoly Burakov anatoly.burakov at intel.com
Tue Jun 25 13:12:24 CEST 2024


From: Grzegorz Nitka <grzegorz.nitka at intel.com>

Return error if there were no recipes found.

Signed-off-by: Grzegorz Nitka <grzegorz.nitka at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 drivers/net/ice/base/ice_switch.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 7f4a7f68de..7528d35ca7 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -2457,6 +2457,11 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
 	if (status)
 		goto err_unroll;
 
+	if (!num_recps) {
+		status = ICE_ERR_PARAM;
+		goto err_unroll;
+	}
+
 	/* Get recipe to profile map so that we can get the fv from lkups that
 	 * we read for a recipe from FW. Since we want to minimize the number of
 	 * times we make this FW call, just make one call and cache the copy
-- 
2.43.0



More information about the dev mailing list