[PATCH v2 31/44] crypto/cnxk: fix segment fault when parse devargs
Chengwen Feng
fengchengwen at huawei.com
Mon Mar 20 10:20:57 CET 2023
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: 135e0b71fa30 ("crypto/cnxk: add max queue pairs limit option")
Cc: stable at dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
drivers/crypto/cnxk/cnxk_cryptodev_devargs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_devargs.c b/drivers/crypto/cnxk/cnxk_cryptodev_devargs.c
index c3e9bdb2d1..936bf8fbf4 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_devargs.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_devargs.c
@@ -16,6 +16,9 @@ parse_max_qps_limit(const char *key, const char *value, void *extra_args)
RTE_SET_USED(key);
uint32_t val;
+ if (value == NULL)
+ return -EINVAL;
+
val = atoi(value);
if (val < CNXK_MAX_QPS_LIMIT_MIN || val > CNXK_MAX_QPS_LIMIT_MAX)
--
2.17.1
More information about the dev
mailing list