[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/19] block/file-posix: fix a possible undefined behavior
From: |
Laurent Vivier |
Subject: |
[PULL 12/19] block/file-posix: fix a possible undefined behavior |
Date: |
Mon, 14 Dec 2020 16:57:26 +0100 |
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>
Message-Id: <20201023061218.2080844-8-kuhn.chenqun@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
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 83e2cc55306c..9804681d5c44 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2111,7 +2111,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.29.2
- [PULL 08/19] ads7846: moves from the hw/display folder to the hw/input folder., (continued)
- [PULL 08/19] ads7846: moves from the hw/display folder to the hw/input folder., Laurent Vivier, 2020/12/14
- [PULL 07/19] CODING_STYLE.rst: Be less strict about 80 character limit, Laurent Vivier, 2020/12/14
- [PULL 04/19] hw/xen: Don't use '#' flag of printf format, Laurent Vivier, 2020/12/14
- [PULL 14/19] configure: Remove the obsolete check for ifaddrs.h, Laurent Vivier, 2020/12/14
- [PULL 09/19] configure: Test if $make actually exists, Laurent Vivier, 2020/12/14
- [PULL 17/19] configure / meson: Move check for sys/signal.h to meson.build, Laurent Vivier, 2020/12/14
- [PULL 18/19] configure / meson: Move check for sys/kcov.h to meson.build, Laurent Vivier, 2020/12/14
- [PULL 19/19] configure / meson: Move check for linux/btrfs.h to meson.build, Laurent Vivier, 2020/12/14
- [PULL 13/19] blockdev: Fix a memleak in drive_backup_prepare(), Laurent Vivier, 2020/12/14
- [PULL 11/19] elf2dmp/pdb: Plug memleak in pdb_init_from_file, Laurent Vivier, 2020/12/14
- [PULL 12/19] block/file-posix: fix a possible undefined behavior,
Laurent Vivier <=
- [PULL 06/19] fsdev: open brace '{' following struct go on the same line, Laurent Vivier, 2020/12/14
- Re: [PULL 00/19] Trivial branch for 6.0 patches, Peter Maydell, 2020/12/15