Negative array index read using variable 'i' as an index to array
'filter_info->pkt_filters'. Fixed by add return value check.
Coverity issue: 350364
Fixes:
f4ca3fd54c4d ("net/hinic: create and destroy flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
ethertype_filter.pkt_proto = filter->ether_type;
i = hinic_ethertype_filter_lookup(filter_info,
ðertype_filter);
+ if (i < 0)
+ return -EINVAL;
if ((filter_info->type_mask & (1 << i))) {
filter_info->pkt_filters[i].enable = FALSE;