From: David Marchand Date: Thu, 19 May 2022 12:21:51 +0000 (+0200) Subject: net/cnxk: fix crash in IPsec telemetry X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a31c9f970dfd192b8eb9106659b8b62e2229a977;p=dpdk.git net/cnxk: fix crash in IPsec telemetry Calling this telemetry callback with no argument caused a crash. Fixes: 41cc645c214f ("net/cnxk: add inline IPsec telemetry for CN9K") Cc: stable@dpdk.org Signed-off-by: David Marchand --- diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c index dfad5af8fe..bfdbd1ee5d 100644 --- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c +++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c @@ -229,6 +229,9 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params, uint32_t i; int ret; + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -EINVAL; + port_id = strtoul(params, &end_p, 0); if (errno != 0) return -EINVAL;