Fix the check logic of the index of the array, which
caused the out of bounds write problem.

Coverity issue: 381616
Fixes: 0666af498761 ("net/nfp: support RSS based on VXLAN inner layer")

Signed-off-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderl...@corigine.com>
---
 drivers/net/nfp/nfp_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index 463eb64b1d..71711bfa22 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -1386,7 +1386,7 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw,
        int ret;
        uint32_t i;
 
-       if (idx > NFP_NET_N_VXLAN_PORTS) {
+       if (idx >= NFP_NET_N_VXLAN_PORTS) {
                PMD_DRV_LOG(ERR, "The idx value is out of range.");
                return -ERANGE;
        }
-- 
2.29.3

Reply via email to