Message ID | 20240206190610.107963-4-stefanha@redhat.com |
---|---|
State | New |
Headers | show |
Series | virtio-blk: iothread-vq-mapping cleanups | expand |
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index e430ba583c..31212506ca 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1209,6 +1209,8 @@ static void virtio_blk_dma_restart_cb(void *opaque, bool running, VirtIOBlockReq *next = rq->next; uint16_t idx = virtio_get_queue_index(rq->vq); + /* Only num_queues vqs were created so vq_rq[idx] is within bounds */ + assert(idx < num_queues); rq->next = vq_rq[idx]; vq_rq[idx] = rq; rq = next;