[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/45] vl: Fix an assert failure in error path
From: |
Paolo Bonzini |
Subject: |
[PULL 02/45] vl: Fix an assert failure in error path |
Date: |
Thu, 17 Jun 2021 11:30:51 +0200 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
Based on the description of error_setg(), the local variable err in
qemu_maybe_daemonize() should be initialized to NULL.
Without fix, the uninitialized *errp triggers assert failure which
doesn't show much valuable information.
Before the fix:
qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL'
failed.
After fix:
qemu-system-x86_64: cannot create PID file: Cannot open pid file: Permission
denied
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20210610084741.456260-1-zhenzhong.duan@intel.com>
Cc: qemu-stable@nongnu.org
Fixes: 0546c0609c ("vl: split various early command line options to a separate
function", 2020-12-10)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
softmmu/vl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 326c1e9080..feb4d201f3 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2522,7 +2522,7 @@ static void qemu_process_help_options(void)
static void qemu_maybe_daemonize(const char *pid_file)
{
- Error *err;
+ Error *err = NULL;
os_daemonize();
rcu_disable_atfork();
--
2.31.1
- [PULL 00/45] Memory, i386, compilation, bugfix changes for 2021-06-17, Paolo Bonzini, 2021/06/17
- [PULL 01/45] vnc: avoid deprecation warnings for SASL on OS X, Paolo Bonzini, 2021/06/17
- [PULL 02/45] vl: Fix an assert failure in error path,
Paolo Bonzini <=
- [PULL 04/45] block/scsi: correctly emulate the VPD block limits page, Paolo Bonzini, 2021/06/17
- [PULL 03/45] qemu-config: use qemu_opts_from_qdict, Paolo Bonzini, 2021/06/17
- [PULL 08/45] esp: allow non-DMA callback in esp_transfer_data() initial transfer, Paolo Bonzini, 2021/06/17
- [PULL 05/45] runstate: Initialize Error * to NULL, Paolo Bonzini, 2021/06/17
- [PULL 06/45] esp: only assert INTR_DC interrupt flag if selection fails, Paolo Bonzini, 2021/06/17
- [PULL 07/45] esp: only set ESP_RSEQ at the start of the select sequence, Paolo Bonzini, 2021/06/17
- [PULL 11/45] esp: revert 75ef849696 "esp: correctly fill bus id with requested lun", Paolo Bonzini, 2021/06/17
- [PULL 14/45] esp: store lun coming from the MESSAGE OUT phase, Paolo Bonzini, 2021/06/17
- [PULL 15/45] softmmu/physmem: Mark shared anonymous memory RAM_SHARED, Paolo Bonzini, 2021/06/17
- [PULL 16/45] softmmu/physmem: Fix ram_block_discard_range() to handle shared anonymous memory, Paolo Bonzini, 2021/06/17