lkml.org 
[lkml]   [2022]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] tools/virtio: Add missing spin_lock_init on virtio_test
Date
A missing spin_lock_init() call can cause the test to hang indefinitely on
spin_lock() at virtqueue creation time.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
tools/virtio/virtio_test.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index d882075c097f..d9cb3d22d52f 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -133,6 +133,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
dev->vdev.dev.driver = &dev->vdriver.driver;
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);
--
2.17.1
\
 
 \ /
  Last update: 2022-02-08 16:26    [W:0.052 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site