hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive

../hw/block/virtio-blk.c:1212:12: error: ‘rq’ may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
This commit is contained in:
Marc-André Lureau 2024-03-28 14:20:46 +04:00
parent 7cea863719
commit 26a690c36e

View File

@ -1060,7 +1060,7 @@ static void virtio_blk_dma_restart_cb(void *opaque, bool running,
VirtIOBlock *s = opaque;
uint16_t num_queues = s->conf.num_queues;
g_autofree VirtIOBlockReq **vq_rq = NULL;
VirtIOBlockReq *rq;
VirtIOBlockReq *rq = NULL;
if (!running) {
return;