vhost: fix possible out of bound access
Fixes: d7280c9fff
("vhost: support selective datapath")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
c8b506e4b6
commit
7b178300ac
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user