From 784fb396f72d98070f3afaf309a7addb4c0d8da1 Mon Sep 17 00:00:00 2001 From: Haggai Eran Date: Thu, 8 Oct 2020 22:42:14 +0300 Subject: [PATCH] cryptodev: fix parameter parsing The rte_cryptodev_pmd_parse_input_args function crashes with a segmentation fault when passing a non-empty argument string. The function passes cryptodev_pmd_valid_params to rte_kvargs_parse, which accepts a NULL-terminated list of valid keys, yet cryptodev_pmd_valid_params does not end with NULL. The patch adds the missing NULL pointer. Fixes: 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation") Cc: stable@dpdk.org Signed-off-by: Haggai Eran Acked-by: Akhil Goyal --- lib/librte_cryptodev/rte_cryptodev_pmd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_cryptodev/rte_cryptodev_pmd.h b/lib/librte_cryptodev/rte_cryptodev_pmd.h index 81975d72b4..1367222f73 100644 --- a/lib/librte_cryptodev/rte_cryptodev_pmd.h +++ b/lib/librte_cryptodev/rte_cryptodev_pmd.h @@ -41,7 +41,8 @@ extern "C" { static const char * const cryptodev_pmd_valid_params[] = { RTE_CRYPTODEV_PMD_NAME_ARG, RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG, - RTE_CRYPTODEV_PMD_SOCKET_ID_ARG + RTE_CRYPTODEV_PMD_SOCKET_ID_ARG, + NULL }; /** -- 2.20.1