This patch fixes (out-of-bounds read) coverity issue.
Coverity issue: 357699, 357694
Fixes:
feaae285b342 ("net/i40e: support hash configuration in RSS flow")
Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
break;
}
+ if (i == UINT64_BIT)
+ return -EINVAL;
+
for (j = I40E_FILTER_PCTYPE_INVALID + 1;
j < I40E_FILTER_PCTYPE_MAX; j++) {
if (pf->adapter->pctypes_tbl[i] & (1ULL << j))
break;
}
+ if (i == UINT64_BIT)
+ return -EINVAL;
+
for (j = I40E_FILTER_PCTYPE_INVALID + 1;
j < I40E_FILTER_PCTYPE_MAX; j++) {
if (pf->adapter->pctypes_tbl[i] & (1ULL << j))