From: Deepthi Kavalur <[email protected]>
The lookup loop in ice_add_adv_recipe() uses a u8 counter, while the
number of lookups is u16. Use a u16 counter, so it cannot wrap around
before reaching the bound.
Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: [email protected]
Signed-off-by: Deepthi Kavalur <[email protected]>
Signed-off-by: Vladimir Medvedkin <[email protected]>
---
drivers/net/intel/ice/base/ice_switch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/intel/ice/base/ice_switch.c
b/drivers/net/intel/ice/base/ice_switch.c
index 94099c5215..cba3ca05fc 100644
--- a/drivers/net/intel/ice/base/ice_switch.c
+++ b/drivers/net/intel/ice/base/ice_switch.c
@@ -8254,7 +8254,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct
ice_adv_lkup_elem *lkups,
struct ice_recp_grp_entry *r_tmp;
struct ice_sw_fv_list_entry *tmp;
struct ice_sw_recipe *rm;
- u8 i;
+ u16 i;
int status = ICE_SUCCESS;
if (!ice_is_prof_rule(rinfo->tun_type) && !lkups_cnt)
--
2.43.0