Acked-by: Liron Himi <lir...@marvell.com> -----Original Message----- From: Chengwen Feng <fengcheng...@huawei.com> Sent: Monday, 20 March 2023 11:21 To: tho...@monjalon.net; ferruh.yi...@amd.com; Zyta Szpak <z...@semihalf.com>; Liron Himi <lir...@marvell.com>; Dmitri Epshtein <d...@marvell.com>; Natalie Samsonov <nsams...@marvell.com>; Andrzej Ostruszka <a...@semihalf.com>; Yelena Krivosheev <yel...@marvell.com> Cc: dev@dpdk.org Subject: [EXT] [PATCH v2 22/44] net/mvneta: fix segment fault when parse devargs
External Email ---------------------------------------------------------------------- The rte_kvargs_process() was used to parse KV pairs, it also supports to parse 'only keys' (e.g. socket_id) type. And the callback function parameter 'value' is NULL when parsed 'only keys'. This patch fixes segment fault when parse input args with 'only keys'. Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton") Cc: sta...@dpdk.org Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> --- drivers/net/mvneta/mvneta_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index d7953ac7cb..babe825ff9 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -91,6 +91,9 @@ mvneta_ifnames_get(const char *key __rte_unused, const char *value, { struct mvneta_ifnames *ifnames = extra_args; + if (value == NULL) + return -EINVAL; + ifnames->names[ifnames->idx++] = value; return 0; -- 2.17.1