[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-pos
From: |
marcandre . lureau |
Subject: |
[PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive |
Date: |
Thu, 28 Mar 2024 14:20:44 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
../migration/block.c:966:16: error: ‘ret’ may be used uninitialized
[-Werror=maybe-uninitialized]
Given that "cluster_size" must be <= BLK_MIG_BLOCK_SIZE, the previous
loop is entered at least once, so 'ret' is assigned a value in all conditions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
migration/block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/block.c b/migration/block.c
index 2b9054889a..486b1bec03 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -877,7 +877,7 @@ static int block_load(QEMUFile *f, void *opaque, int
version_id)
uint8_t *buf;
int64_t total_sectors = 0;
int nr_sectors;
- int ret;
+ int ret = -EINVAL;
BlockDriverInfo bdi;
int cluster_size = BLK_MIG_BLOCK_SIZE;
--
2.44.0
- [PATCH 03/19] hw/qxl: fix -Werror=maybe-uninitialized false-positives, (continued)
- [PATCH 03/19] hw/qxl: fix -Werror=maybe-uninitialized false-positives, marcandre . lureau, 2024/03/28
- [PATCH 04/19] nbd: with -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 05/19] block/mirror: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives, marcandre . lureau, 2024/03/28
- [PATCH 07/19] hw/ahci: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 08/19] hw/vhost-scsi: fix -Werror=maybe-uninitialized, marcandre . lureau, 2024/03/28
- [PATCH 09/19] hw/sdhci: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 10/19] hw/rdma: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive,
marcandre . lureau <=
- [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