[EXT] [PATCH v2 25/44] net/octeontx: fix segment fault when parse devargs
Harman Kalra
hkalra at marvell.com
Wed Apr 12 09:54:22 CEST 2023
Hi,
Thanks for fixing the seg fault.
Acked-by: Harman Kalra <hkalra at marvell.com>
Thanks
Harman
> -----Original Message-----
> From: Chengwen Feng <fengchengwen at huawei.com>
> Sent: Monday, March 20, 2023 2:51 PM
> To: thomas at monjalon.net; ferruh.yigit at amd.com; Harman Kalra
> <hkalra at marvell.com>; Santosh Shukla
> <santosh.shukla at caviumnetworks.com>; Jerin Jacob
> <jerin.jacob at caviumnetworks.com>
> Cc: dev at dpdk.org
> Subject: [EXT] [PATCH v2 25/44] net/octeontx: fix segment fault when parse
> devargs
>
> External Email
>
> ----------------------------------------------------------------------
> 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: f7be70e5130e ("net/octeontx: add net device probe and remove")
> Cc: stable at dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> ---
> drivers/net/octeontx/octeontx_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/octeontx/octeontx_ethdev.c
> b/drivers/net/octeontx/octeontx_ethdev.c
> index d52a3e73d5..d11f359c7b 100644
> --- a/drivers/net/octeontx/octeontx_ethdev.c
> +++ b/drivers/net/octeontx/octeontx_ethdev.c
> @@ -70,6 +70,9 @@ parse_integer_arg(const char *key __rte_unused, {
> int *i = (int *)extra_args;
>
> + if (value == NULL)
> + return -EINVAL;
> +
> *i = atoi(value);
> if (*i < 0) {
> octeontx_log_err("argument has to be positive.");
> --
> 2.17.1
More information about the dev
mailing list