[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/64] vl: Fix an assert failure in error path
From: |
Michael Roth |
Subject: |
[PATCH 23/64] vl: Fix an assert failure in error path |
Date: |
Tue, 19 Oct 2021 09:09:03 -0500 |
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>
(cherry picked from commit 38f71349c7c4969bc14da4da1c70b8cc4078d596)
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
softmmu/vl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 6be510b035..848b98851c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2508,7 +2508,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.25.1
- [PATCH 14/64] vl: plug -object back into -readconfig, (continued)
- [PATCH 14/64] vl: plug -object back into -readconfig, Michael Roth, 2021/10/19
- [PATCH 15/64] sockets: update SOCKET_ADDRESS_TYPE_FD listen(2) backlog, Michael Roth, 2021/10/19
- [PATCH 16/64] hmp: Fix loadvm to resume the VM on success instead of failure, Michael Roth, 2021/10/19
- [PATCH 17/64] configure: fix detection of gdbus-codegen, Michael Roth, 2021/10/19
- [PATCH 18/64] vhost-vdpa: don't initialize backend_features, Michael Roth, 2021/10/19
- [PATCH 19/64] esp: only assert INTR_DC interrupt flag if selection fails, Michael Roth, 2021/10/19
- [PATCH 20/64] esp: only set ESP_RSEQ at the start of the select sequence, Michael Roth, 2021/10/19
- [PATCH 01/64] multi-process: Initialize variables declared with g_auto*, Michael Roth, 2021/10/19
- [PATCH 21/64] runstate: Initialize Error * to NULL, Michael Roth, 2021/10/19
- [PATCH 22/64] vfio: Fix unregister SaveVMHandler in vfio_migration_finalize, Michael Roth, 2021/10/19
- [PATCH 23/64] vl: Fix an assert failure in error path,
Michael Roth <=
- [PATCH 24/64] tcg/sparc: Fix temp_allocate_frame vs sparc stack bias, Michael Roth, 2021/10/19
- [PATCH 25/64] tcg: Allocate sufficient storage in temp_allocate_frame, Michael Roth, 2021/10/19
- [PATCH 26/64] hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field, Michael Roth, 2021/10/19
- [PATCH 27/64] block/nvme: Fix VFIO_MAP_DMA failed: No space left on device, Michael Roth, 2021/10/19
- [PATCH 28/64] crypto/tlscreds: Introduce qcrypto_tls_creds_check_endpoint() helper, Michael Roth, 2021/10/19
- [PATCH 29/64] block/nbd: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 30/64] qemu-nbd: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 02/64] linux-user/aarch64: Enable hwcap for RND, BTI, and MTE, Michael Roth, 2021/10/19
- [PATCH 31/64] chardev/socket: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 32/64] migration/tls: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19