vhost: fix virtqueue initialization
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Fri, 6 Nov 2020 14:47:44 +0000 (15:47 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 18:43:25 +0000 (19:43 +0100)
commit7804bbd13aa583e3a28b08557f7a98fcbe7fc8a8
tree1e02fedf5a1a3816799935ccfcf84fbd750d2bf9
parent45ba914134075f67200f55e5b5a9ad8b3da4df48
vhost: fix virtqueue initialization

This patches fixes virtqueue initialization issue causing
segfault or file descriptor being closed unexpectedly.

The wrong index was passed to init_vring_queue() by
alloc_vring_queue() when a hole in the virtqueue array was
met.

Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
Cc: stable@dpdk.org
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
lib/librte_vhost/vhost.c