[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/10] block/file-posix: fix a possible undefined behavior
From: |
Pan Nengyuan |
Subject: |
[PATCH v2 09/10] block/file-posix: fix a possible undefined behavior |
Date: |
Mon, 31 Aug 2020 09:43:14 -0400 |
local_err is not initialized to NULL, it will cause a assert error as below:
qemu/util/error.c:59: error_setv: Assertion `*errp == NULL' failed.
Fixes: c6447510690
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
---
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Aarushi Mehta <mehta.aaru20@gmail.com>
Cc: qemu-block@nongnu.org
---
- V2: no changes in v2.
---
block/file-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 9a00d4190a..697a7d9eea 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2113,7 +2113,7 @@ static void raw_aio_attach_aio_context(BlockDriverState
*bs,
#endif
#ifdef CONFIG_LINUX_IO_URING
if (s->use_linux_io_uring) {
- Error *local_err;
+ Error *local_err = NULL;
if (!aio_setup_linux_io_uring(new_context, &local_err)) {
error_reportf_err(local_err, "Unable to use linux io_uring, "
"falling back to thread pool: ");
--
2.18.2
- [PATCH v2 00/10] fix some error memleaks, Pan Nengyuan, 2020/08/31
- [PATCH v2 01/10] qga/channel-posix: Plug memory leak in ga_channel_write_all(), Pan Nengyuan, 2020/08/31
- [PATCH v2 04/10] target/i386/sev: Plug memleak in sev_read_file_base64, Pan Nengyuan, 2020/08/31
- [PATCH v2 07/10] migration/colo: Plug memleaks in colo_process_incoming_thread, Pan Nengyuan, 2020/08/31
- [PATCH v2 03/10] elf2dmp/pdb: Plug memleak in pdb_init_from_file, Pan Nengyuan, 2020/08/31
- [PATCH v2 06/10] target/i386/cpu: Fix memleak in x86_cpu_class_check_missing_features, Pan Nengyuan, 2020/08/31
- [PATCH v2 09/10] block/file-posix: fix a possible undefined behavior,
Pan Nengyuan <=
- [PATCH v2 08/10] blockdev: Fix a memleak in drive_backup_prepare(), Pan Nengyuan, 2020/08/31
- [PATCH v2 10/10] vnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string, Pan Nengyuan, 2020/08/31
- [PATCH v2 02/10] elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init, Pan Nengyuan, 2020/08/31
- [PATCH v2 05/10] ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context(), Pan Nengyuan, 2020/08/31