From: Long Wu <long...@corigine.com>

CI found that overrunning array of 8 bytes at byte
offset 8 by dereferencing pointer.

Coverity issue: 403098
Fixes: 9641a2d ("net/nfp: refactor rtsym module")
Cc: chaoyong...@corigine.com
Cc: sta...@dpdk.org

Signed-off-by: Long Wu <long...@corigine.com>
Reviewed-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_rtsym.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c 
b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 022753f98a..5cefbace96 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -337,7 +337,7 @@ nfp_rtsym_read_real(struct nfp_cpp *cpp,
        size_t length = len;
        uint64_t sym_size = nfp_rtsym_size(sym);
 
-       if (offset > sym_size) {
+       if (offset >= sym_size) {
                PMD_DRV_LOG(ERR, "rtsym '%s' read out of bounds", sym->name);
                return -ENXIO;
        }
-- 
2.39.1

Reply via email to