[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vl: Fix an assert failure in error path
From: |
Markus Armbruster |
Subject: |
Re: [PATCH] vl: Fix an assert failure in error path |
Date: |
Wed, 09 Jun 2021 14:09:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 10/06/21 10:47, Zhenzhong Duan wrote:
>> 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>
>> ---
>> 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;
Common mistake, I'm afraid.
>> os_daemonize();
>> rcu_disable_atfork();
>>
>
> Queued, thanks.
Suggest to amend the commit message with
Fixes: 03d2b412aaf2078425f8472f31c8a9c2340969eb