index = i + 1;
/* check for room */
- if (first_free + 1 < ice_fd_pairs[index].count)
+ if (first_free + 1 < (s8)ice_fd_pairs[index].count)
return ICE_ERR_MAX_LIMIT;
/* place in extraction sequence */
es[first_free - k].off =
ice_fd_pairs[index].off + (k * 2);
+ if (k > first_free)
+ return ICE_ERR_OUT_OF_RANGE;
+
/* keep track of non-relevant fields */
mask_sel |= 1 << (first_free - k);
}
p->tcam[i].prof_id = map->prof_id;
p->tcam[i].tcam_idx = ICE_INVALID_TCAM;
- if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg))
+ if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg)) {
+ ice_free(hw, p);
return ICE_ERR_CFG;
+ }
p->tcam[i].ptg = ptg;
}