[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RESEND v2 7/7] block/file-posix: fix a possible undefined behavio
From: |
Chen Qun |
Subject: |
[PATCH RESEND v2 7/7] block/file-posix: fix a possible undefined behavior |
Date: |
Fri, 23 Oct 2020 14:12:18 +0800 |
From: Pan Nengyuan <pannengyuan@huawei.com>
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>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
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 c63926d592..b711124672 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2110,7 +2110,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.23.0
- [PATCH RESEND v2 0/7] some memleak trivial patchs, Chen Qun, 2020/10/23
- [PATCH RESEND v2 4/7] elf2dmp/pdb: Plug memleak in pdb_init_from_file, Chen Qun, 2020/10/23
- [PATCH RESEND v2 7/7] block/file-posix: fix a possible undefined behavior,
Chen Qun <=
- [PATCH RESEND v2 1/7] tests/migration: fix memleak in wait_command/wait_command_fd, Chen Qun, 2020/10/23
- [PATCH RESEND v2 5/7] migration/colo: Plug memleaks in colo_process_incoming_thread, Chen Qun, 2020/10/23
- [PATCH RESEND v2 2/7] qga/channel-posix: Plug memory leak in ga_channel_write_all(), Chen Qun, 2020/10/23
- [PATCH RESEND v2 3/7] elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init, Chen Qun, 2020/10/23
- [PATCH RESEND v2 6/7] blockdev: Fix a memleak in drive_backup_prepare(), Chen Qun, 2020/10/23
- RE: [PATCH RESEND v2 0/7] some memleak trivial patchs, Chenqun (kuhn), 2020/10/30