[PATCH v2 13/16] app/test-dma-perf: verify strdup return value
lihuisong (C)
lihuisong at huawei.com
Tue Nov 21 04:32:31 CET 2023
Acked-by: Huisong Li <lihuisong at huawei.com>
在 2023/11/10 18:01, Chengwen Feng 写道:
> Add verify strdup return value logic.
>
> Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
> Cc: stable at dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> ---
> app/test-dma-perf/main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
> index e5bccc27da..339ee25eb5 100644
> --- a/app/test-dma-perf/main.c
> +++ b/app/test-dma-perf/main.c
> @@ -206,6 +206,8 @@ parse_lcore_dma(struct test_configure *test_case, const char *value)
> return -1;
>
> input = strndup(value, strlen(value) + 1);
> + if (input == NULL)
> + return -1;
> addrs = input;
>
> while (*addrs == '\0')
More information about the dev
mailing list