Skip to content

Commit

Permalink
examples/vhost: verify strdup return
Browse files Browse the repository at this point in the history
[ upstream commit b119863bd6643558af3ac3b39a63b6524e7545eb ]

Add verify strdup return value logic.

Fixes: 53d3f47 ("vhost: integrate dmadev in asynchronous data-path")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
  • Loading branch information
fengchengwen authored and bluca committed Mar 7, 2024
1 parent 7d35dff commit e0cc2ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/vhost/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,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') {
Expand Down

0 comments on commit e0cc2ba

Please sign in to comment.