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: b1bbf222bef1 ("crypto/dpaa_sec: add debug prints") Cc: sta...@dpdk.org Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> --- drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index db52683847..2e2940f011 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3584,6 +3584,9 @@ static int check_devargs_handler(__rte_unused const char *key, const char *value, __rte_unused void *opaque) { + if (value == NULL) + return -EINVAL; + dpaa_sec_dp_dump = atoi(value); if (dpaa_sec_dp_dump > DPAA_SEC_DP_FULL_DUMP) { DPAA_SEC_WARN("WARN: DPAA_SEC_DP_DUMP_LEVEL is not " -- 2.17.1