[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/19] tests: fix -Werror=maybe-uninitialized
From: |
marcandre . lureau |
Subject: |
[PATCH 16/19] tests: fix -Werror=maybe-uninitialized |
Date: |
Thu, 28 Mar 2024 14:20:49 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
../tests/unit/test-block-iothread.c:773:17: error: ‘job’ may be used
uninitialized [-Werror=maybe-uninitialized]
/usr/include/glib-2.0/glib/gtestutils.h:73:53: error: ‘ret’ may be used
uninitialized [-Werror=maybe-uninitialized]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
tests/unit/test-bdrv-drain.c | 2 +-
tests/unit/test-block-iothread.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c
index 666880472b..c112d5b189 100644
--- a/tests/unit/test-bdrv-drain.c
+++ b/tests/unit/test-bdrv-drain.c
@@ -722,7 +722,7 @@ static void test_blockjob_common_drain_node(enum drain_type
drain_type,
BlockJob *job;
TestBlockJob *tjob;
IOThread *iothread = NULL;
- int ret;
+ int ret = -1;
src = bdrv_new_open_driver(&bdrv_test, "source", BDRV_O_RDWR,
&error_abort);
diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothread.c
index 3766d5de6b..20ed54f570 100644
--- a/tests/unit/test-block-iothread.c
+++ b/tests/unit/test-block-iothread.c
@@ -745,7 +745,7 @@ static void test_propagate_mirror(void)
AioContext *main_ctx = qemu_get_aio_context();
BlockDriverState *src, *target, *filter;
BlockBackend *blk;
- Job *job;
+ Job *job = NULL;
Error *local_err = NULL;
/* Create src and target*/
--
2.44.0
- [PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive, (continued)
- [PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/03/28
- [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 <=
- [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, 2024/03/28
- [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