[PATCH v2 16/16] examples/vhost: verify strdup return value

lihuisong (C) lihuisong at huawei.com
Tue Nov 21 04:35:04 CET 2023


Acked-by: Huisong Li <lihuisong at huawei.com>

在 2023/11/10 18:01, Chengwen Feng 写道:
> Add verify strdup return value logic.
>
> Fixes: 53d3f4778c1d ("vhost: integrate dmadev in asynchronous data-path")
> Cc: stable at dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> ---
>   examples/vhost/main.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index ce5c1efddf..3fc1b151d1 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -260,6 +260,9 @@ open_dma(const char *value)
>   	char *dma_arg[RTE_MAX_VHOST_DEVICE];
>   	int args_nr;
>   
> +	if (input == NULL)
> +		return -1;
> +
>   	while (isblank(*addrs))
>   		addrs++;
>   	if (*addrs == '\0') {


More information about the dev mailing list