From 88fab00d4402af240c1b7cc2566133aece115488 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 12 Nov 2018 16:14:45 +0000 Subject: New upstream version 18.11-rc2 Change-Id: I43ca4edd0747b2dfc38c574ebf3c0aac17d7392c Signed-off-by: Luca Boccassi --- lib/librte_vhost/vdpa.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/librte_vhost/vdpa.c') diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index c2c5dff1..e7d849ee 100644 --- a/lib/librte_vhost/vdpa.c +++ b/lib/librte_vhost/vdpa.c @@ -63,6 +63,9 @@ rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr, break; } + if (i == MAX_VHOST_DEVICE) + return -1; + sprintf(device_name, "vdpa-dev-%d", i); dev = rte_zmalloc(device_name, sizeof(struct rte_vdpa_device), RTE_CACHE_LINE_SIZE); -- cgit 1.2.3-korg