From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54236C2B9F4 for ; Thu, 17 Jun 2021 09:33:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 051E1613F5 for ; Thu, 17 Jun 2021 09:33:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 051E1613F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltoPC-0005j1-31 for qemu-devel@archiver.kernel.org; Thu, 17 Jun 2021 05:33:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltoNB-0002a1-0h; Thu, 17 Jun 2021 05:31:41 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:44736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltoN8-00060W-Vg; Thu, 17 Jun 2021 05:31:40 -0400 Received: by mail-ed1-x52a.google.com with SMTP id u24so3017693edy.11; Thu, 17 Jun 2021 02:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R0+AwUXW3F+3xw6jgijJ3i774wGZg+ICftnnBWgQ9fA=; b=Sp/voqCK4St+zItPkwDM9X8sXGTpdFyHS5ZFLpz1DD1rZQbtHo1+0MqzwPO/2JlYFj jBPUaRrXIGr1klCt3yYEdgD905fKOFABPTaUFminHXdvJfiR+3xvpQJwRIrYG5tVIuKC EyW0gcphH2epeYuigNw5c8fyyptrEl3S7IuZdJO4qsQULe+y2XhHGaSlrZg0DDBxswsi FiT/WSf+L1dxBZi+5tmh2giBdAaKlyt8g2p0rkOfNXAUfrpvq4NFxKflq3kAG4nxytsa VAKNy7pB2dkHrtC0q2vIbq6Il6d12gunb41Jy7lJoZaAQVyj2zVfx193zOWtW/BqWhCq WTDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R0+AwUXW3F+3xw6jgijJ3i774wGZg+ICftnnBWgQ9fA=; b=ph+3jEECuY6/o3n2ORGEVYL62tal0knjo72Gmu5TDbDDj9Nza99tWzGYjxtwTBP5Yw GAtjWHHh8optSIrG+rclrYk6TE63JUeYph2ZpyvYGbv1N1oBpZz8nkTZSpgxTLq6U39b LtAmCSvWeb8xzbVMDH37TnNq/l5SLhz30sT0KQDNOAnVxlIcKD7W/J2FgZcuB/G51fnv M3dVRddUEKlDcvYRkxwYBAgDzUNdj9D8ErZbZ5eNlykLHUCmgy1vajMppus1eszzdvkH 8DplKJ/wWWuqdHhtpyzn1qkylxKWR0nIcasgvrduo/04lVg6gGO9frh+zU+TacIqcmRa YLwQ== X-Gm-Message-State: AOAM530vt8b9gZtpWL/gQ7RRyVfe3AH21+MCfVeXIMt6u73LVVah4s8G nL5o7lQGHL7ZETi44P4q9LwCgqkLQSY= X-Google-Smtp-Source: ABdhPJwhuEaCHDhjlb9MuZOn+u978Ean1I1gAx4fJnQEnJUXXdwdBpoVeanSymqgmrhJwn6CuSq18g== X-Received: by 2002:a05:6402:28a:: with SMTP id l10mr5178173edv.365.1623922296680; Thu, 17 Jun 2021 02:31:36 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m18sm3328140ejx.56.2021.06.17.02.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 02:31:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 02/45] vl: Fix an assert failure in error path Date: Thu, 17 Jun 2021 11:30:51 +0200 Message-Id: <20210617093134.900014-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210617093134.900014-1-pbonzini@redhat.com> References: <20210617093134.900014-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhenzhong Duan , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Zhenzhong Duan 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 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 --- 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