X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvdpa.c;h=e7d849ee0f4f1f91661cdf0dcebbbb7365e3b4ba;hp=c2c5dff1d44332779837a0843b0ec550491974e0;hb=88fab00d4402af240c1b7cc2566133aece115488;hpb=8d01b9cd70a67cdafd5b965a70420c3bd7fb3f82 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);