[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/27] migration/qemu-file: Fix maybe uninitialized on qemu_get_bu
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 04/27] migration/qemu-file: Fix maybe uninitialized on qemu_get_buffer_in_place() |
Date: |
Thu, 4 Feb 2021 16:39:36 +0000 |
From: Wainer dos Santos Moschetta <wainersm@redhat.com>
Fixed error when compiling migration/qemu-file.c with
-Werror=maybe-uninitialized
as shown here:
../migration/qemu-file.c: In function 'qemu_get_buffer_in_place':
../migration/qemu-file.c:604:18: error: 'src' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
604 | *buf = src;
| ~~~~~^~~~~
cc1: all warnings being treated as errors
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210128130625.569900-1-wainersm@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/qemu-file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index be21518c57..d6e03dbc0e 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -595,7 +595,7 @@ size_t qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf,
size_t size)
{
if (size < IO_BUF_SIZE) {
size_t res;
- uint8_t *src;
+ uint8_t *src = NULL;
res = qemu_peek_buffer(f, &src, size, 0);
--
2.29.2
- [PULL 00/27] migration queue, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 02/27] savevm: Fix memory leak of vmstate_configuration, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 04/27] migration/qemu-file: Fix maybe uninitialized on qemu_get_buffer_in_place(),
Dr. David Alan Gilbert (git) <=
- [PULL 01/27] spapr_pci: Fix memory leak of vmstate_spapr_pci, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 03/27] vmstate: Fix memory leak in vmstate_handle_alloc(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 05/27] migration: introduce 'background-snapshot' migration capability, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 06/27] migration: introduce UFFD-WP low-level interface helpers, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 07/27] migration: support UFFD write fault processing in ram_save_iterate(), Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 08/27] migration: implementation of background snapshot thread, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 09/27] migration: introduce 'userfaultfd-wrlat.py' script, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 10/27] migration: Fix migrate-set-parameters argument validation, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 11/27] migration: Clean up signed vs. unsigned XBZRLE cache-size, Dr. David Alan Gilbert (git), 2021/02/04
- [PULL 12/27] migration: Fix cache_init()'s "Failed to allocate" error messages, Dr. David Alan Gilbert (git), 2021/02/04