From: Danylo Vodopianov <dvo-...@napatech.com>

CI found couple coverity problems which were fixed in this commit.

CID: 448974, 448977, 448978 (OVERRUN).

These issues were fixed with updating index verification statement.

Coverity issue: 448974
Fixes: effa04693274 ("net/ntnic: add statistics")

Signed-off-by: Danylo Vodopianov <dvo-...@napatech.com>
---
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c 
b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
index 4c8503f689..e00b10ff82 100644
--- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
+++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
@@ -1201,7 +1201,7 @@ static int poll_statistics(struct pmd_internals 
*internals)
        const int if_index = internals->n_intf_no;
        uint64_t last_stat_rtc = 0;
 
-       if (!p_nt4ga_stat || if_index < 0 || if_index > NUM_ADAPTER_PORTS_MAX)
+       if (!p_nt4ga_stat || if_index < 0 || if_index >= NUM_ADAPTER_PORTS_MAX)
                return -1;
 
        assert(rte_tsc_freq > 0);
-- 
2.45.0

Reply via email to