summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2022-01-18 18:06:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 15:22:47 +0300
commitafffb79a2dd520eae2659c848d0f62a5ce4edfcf (patch)
tree3ba3904e964f14da1c55da274deb676fa5a51e54 /tools
parentf8f8e96048ad3b4fb7f45bd9dbceb79608dd8d55 (diff)
downloadlinux-afffb79a2dd520eae2659c848d0f62a5ce4edfcf.tar.xz
tools/virtio: fix virtio_test execution
[ Upstream commit 32f1b53fe8f03d962423ba81f8e92af5839814da ] virtio_test hangs on __vring_new_virtqueue() because `vqs_list_lock` is not initialized. Let's initialize it in vdev_info_init(). Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://lore.kernel.org/r/20220118150631.167015-1-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtio/virtio_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index cb3f29c09aff..23f142af544a 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -130,6 +130,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
memset(dev, 0, sizeof *dev);
dev->vdev.features = features;
INIT_LIST_HEAD(&dev->vdev.vqs);
+ spin_lock_init(&dev->vdev.vqs_list_lock);
dev->buf_size = 1024;
dev->buf = malloc(dev->buf_size);
assert(dev->buf);