[PATCH v1 20/31] net/ntnic: fix array verification
Serhii Iliushyk
sil-plv at napatech.com
Tue Jan 21 18:07:58 CET 2025
From: Danylo Vodopianov <dvo-plv at napatech.com>
if statement was modify to ensure that word_off
doesn't exceed the size of the array
Coverity issue: 448958
Fixes: 7fa0bf29e667 ("net/ntnic: add hash module")
Signed-off-by: Danylo Vodopianov <dvo-plv at napatech.com>
---
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
index cc8db2fae5..d19e72e323 100644
--- a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
+++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
@@ -221,7 +221,7 @@ static int hw_mod_hsh_rcp_mod(struct flow_api_backend_s *be, enum hw_hsh_e field
break;
case HW_HSH_RCP_WORD_MASK:
- if (word_off > HSH_RCP_WORD_MASK_SIZE) {
+ if (word_off >= HSH_RCP_WORD_MASK_SIZE) {
WORD_OFF_TOO_LARGE_LOG;
return WORD_OFF_TOO_LARGE;
}
--
2.45.0
More information about the dev
mailing list