[PATCH v1 06/31] net/ntnic: fix array index verification
    Serhii Iliushyk 
    sil-plv at napatech.com
       
    Tue Jan 21 18:07:44 CET 2025
    
    
  
From: Danylo Vodopianov <dvo-plv at napatech.com>
CI found couple coverity problems which were fixed in this commit.
CID: 448983 Out-of-bounds write (OVERRUN).
These issues were fixed with updating index verification statement.
Coverity issue: 448983
Fixes: 96c8249be53e ("net/ntnic: learn flow queue handling")
Signed-off-by: Danylo Vodopianov <dvo-plv at napatech.com>
---
 drivers/net/ntnic/ntnic_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 620d023a71..28b086c009 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -140,7 +140,7 @@ store_pdrv(struct drv_s *p_drv)
 
 static void clear_pdrv(struct drv_s *p_drv)
 {
-	if (p_drv->adapter_no > NUM_ADAPTER_MAX)
+	if (p_drv->adapter_no >= NUM_ADAPTER_MAX)
 		return;
 
 	rte_spinlock_lock(&hwlock);
-- 
2.45.0
    
    
More information about the dev
mailing list