net/i40e: fix negative VEB index
authorChengwen Feng <fengchengwen@huawei.com>
Wed, 21 Apr 2021 02:33:13 +0000 (10:33 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 23 Apr 2021 08:59:22 +0000 (10:59 +0200)
This patch adds check for negative VEB index when parsing VEB list.

Fixes: 79f2248219c0 ("net/i40e: add floating VEB option")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_ethdev.c

index 66d23d6..d058620 100644 (file)
@@ -854,6 +854,8 @@ floating_veb_list_handler(__rte_unused const char *key,
                idx = strtoul(floating_veb_value, &end, 10);
                if (errno || end == NULL)
                        return -1;
+               if (idx < 0)
+                       return -1;
                while (isblank(*end))
                        end++;
                if (*end == '-') {