]> git.droids-corp.org - dpdk.git/commitdiff
net/cnxk: fix crash in IPsec telemetry
authorDavid Marchand <david.marchand@redhat.com>
Thu, 19 May 2022 12:21:51 +0000 (14:21 +0200)
committerJerin Jacob <jerinj@marvell.com>
Mon, 13 Jun 2022 12:08:44 +0000 (14:08 +0200)
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 <david.marchand@redhat.com>
drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c

index dfad5af8fea3661f8d1fcafc8c543fe833ef2f2b..bfdbd1ee5dc7e3527a0bbfcd34b3404198833fb5 100644 (file)
@@ -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;