[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/19] hw/virtio: fix -Werror=maybe-uninitialized
From: |
marcandre . lureau |
Subject: |
[PATCH 18/19] hw/virtio: fix -Werror=maybe-uninitialized |
Date: |
Thu, 28 Mar 2024 14:20:51 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
../hw/virtio/vhost-shadow-virtqueue.c:545:13: error: ‘r’ may be used
uninitialized [-Werror=maybe-uninitialized]
'&r' is not guaranteed to be assigned when calling -Werror=maybe-uninitialized.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index fc5f408f77..cd29cc795b 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -526,7 +526,7 @@ static void vhost_svq_flush(VhostShadowVirtqueue *svq,
size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t num)
{
size_t len = 0;
- uint32_t r;
+ uint32_t r = 0;
while (num--) {
int64_t start_us = g_get_monotonic_time();
--
2.44.0
- [PATCH 12/19] migration: fix -Werror=maybe-uninitialized false-positives, (continued)
- [PATCH 12/19] migration: fix -Werror=maybe-uninitialized false-positives, marcandre . lureau, 2024/03/28
- [PATCH 13/19] hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 14/19] plugins: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 15/19] migration: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 16/19] tests: fix -Werror=maybe-uninitialized, marcandre . lureau, 2024/03/28
- [PATCH 17/19] hw/nvme: fix -Werror=maybe-uninitialized, marcandre . lureau, 2024/03/28
- [PATCH 18/19] hw/virtio: fix -Werror=maybe-uninitialized,
marcandre . lureau <=
- [PATCH 19/19] RFC: hw/virtio: a potential leak fix, marcandre . lureau, 2024/03/28
- Re: [PATCH 00/19] -Werror=maybe-uninitialized fixes, Eric Blake, 2024/03/28