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: 0a50a5aad299 ("mempool/cnxk: add device probe/remove") Cc: sta...@dpdk.org Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> --- drivers/mempool/cnxk/cnxk_mempool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mempool/cnxk/cnxk_mempool.c b/drivers/mempool/cnxk/cnxk_mempool.c index 78caf987d0..d803e5928d 100644 --- a/drivers/mempool/cnxk/cnxk_mempool.c +++ b/drivers/mempool/cnxk/cnxk_mempool.c @@ -36,6 +36,9 @@ parse_max_pools_handler(const char *key, const char *value, void *extra_args) RTE_SET_USED(key); uint32_t val; + if (value == NULL) + return -EINVAL; + val = rte_align32pow2(atoi(value)); if (val < npa_aura_size_to_u32(NPA_AURA_SZ_128)) val = 128; -- 2.17.1