From nobody Mon Feb 9 08:03:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576671460; cv=none; d=zohomail.com; s=zohoarc; b=IWrkNJO84zR9Z8AJ0umQ9NBCRC6Rya6PU/Ci4HxiyVaTmU4V/bIURLpjmEf/FZ7dQkJG1sHZkbyqW0QxmciErMz6JtPKWJahjcF8WppqbSNNBcObE9Mb3L8ec4Y8t5i3n3QWI1zQABo7lLjoe3cJ+QSIBldbqM8jGCptwvrYh3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576671460; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SnbM4HZb29FsG4J6fiW5WwWfE0ShjwYvCK5bmD3CYRU=; b=NABusbWK2RDVtNWDdA1xRJstrO0N2C/FzQIaTOYWc0xUInkAdJrZ/y08flkzLRcQJ0qkt2DA1jG40Dc+V3+NA1TQqUnKFc/W2I5LtyCCjqxPdBL3wPQ1mx/INja4hgUU7uIS4/YxoblTWTN8xBfS5/F/lFakO8AlYiWurIjHR0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157667146071791.31534009290374; Wed, 18 Dec 2019 04:17:40 -0800 (PST) Received: from localhost ([::1]:53330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihYGn-0000Nc-Ie for importer@patchew.org; Wed, 18 Dec 2019 07:17:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48418) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihY3B-0006NX-H5 for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihY3A-0000kh-9p for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:33 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:46592) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihY3A-0000hB-1i for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:32 -0500 Received: by mail-wr1-x434.google.com with SMTP id z7so1963174wrl.13 for ; Wed, 18 Dec 2019 04:03:31 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n67sm2236838wmf.46.2019.12.18.04.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2019 04:03:30 -0800 (PST) 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=SnbM4HZb29FsG4J6fiW5WwWfE0ShjwYvCK5bmD3CYRU=; b=k74tXKopfKzRPy/wQkZEPWyGWwStkA7fEXXEmn2NxdV+grs0EapWmEJ2Afonm/eJjG GkX8+L6pr4Qc4wm3C06iM8VDGpyTTNIiF9J+qDZRcAkcpbJZbBs/OK/ta/szGZprBnLH nqksaUXuMKIxwElnc41+AiJ2zodKk3LfArk2WRzZ019vMN+nC/3WOavUwqdRGP6BUoat 2OYZQ1ErBOtXnpakoXJkddVW82XjuobCy/E4DSxayZDR14Qxc2LS/MAKFKG/wczXLaSF 6cyDX+EmSmR4tP2f+gkkbNgwQLVHp6s9Q2HSWBpdJT9ZVfFoBle/iFH4hku1VtEEGYaw l0Pg== 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=SnbM4HZb29FsG4J6fiW5WwWfE0ShjwYvCK5bmD3CYRU=; b=iNzep+bK90HrmKgTDTbnrX0+E+tGSAFJK84lMBvL42rZAx19g8aQzYBhjutIfraTD+ 0CFtX39tg+I3YHPYrBqiLvyAwu4+DEcC2UFGOCeug4x/qiXYGdsigj5q9agayp+16h1D xxwMA3G05t6Ii9kU+vkmXUjyO0ph0WQ076zFBDeKQ4pxY803E/Q5NmJckHJ7DgU1Ajg/ C6xaJt4BpOuKYc5z44UdhGvo3hnERMmCrC/n4yr07BFw0ROXA467seiwHhBw0o+TDyT7 GLA6oriwq2bUFDec05wMU5Tdx5UTkav7U0o+u2xTvoF84sDHe3X6+hAxkH02IkjBLJt8 iBhw== X-Gm-Message-State: APjAAAVd+lSMSEDTu7UC3URWQ1yHF+ustkCbKTLzWz3e9aqsB1G45NCo 1UXgp4MiGMZgPjvUGFrfTBg4ehT7 X-Google-Smtp-Source: APXvYqwE3r6OKAQOed6N+x8WWR8x6cTahbcHKP9KJJXfsw2dJMOzZ5XKEkY0k4YyE6MjKJSoGZ6F9A== X-Received: by 2002:a5d:6a8e:: with SMTP id s14mr2543802wru.150.1576670610728; Wed, 18 Dec 2019 04:03:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 35/87] monitor: fix maybe-uninitialized Date: Wed, 18 Dec 2019 13:02:01 +0100 Message-Id: <1576670573-48048-36-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> References: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau ../monitor/misc.c: In function =E2=80=98mon_get_cpu_sync=E2=80=99: /home/elmarco/src/qq/include/sysemu/hw_accel.h:22:9: error: =E2=80=98cpu=E2= =80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitia= lized] 22 | kvm_cpu_synchronize_state(cpu); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../monitor/misc.c:397:15: note: =E2=80=98cpu=E2=80=99 was declared here 397 | CPUState *cpu; | ^~~ Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- monitor/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor/misc.c b/monitor/misc.c index 3baa15f..a74cff3 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -394,7 +394,7 @@ int monitor_set_cpu(int cpu_index) /* Callers must hold BQL. */ static CPUState *mon_get_cpu_sync(bool synchronize) { - CPUState *cpu; + CPUState *cpu =3D NULL; =20 if (cur_mon->mon_cpu_path) { cpu =3D (CPUState *) object_resolve_path_type(cur_mon->mon_cpu_pat= h, @@ -411,6 +411,7 @@ static CPUState *mon_get_cpu_sync(bool synchronize) monitor_set_cpu(first_cpu->cpu_index); cpu =3D first_cpu; } + assert(cpu !=3D NULL); if (synchronize) { cpu_synchronize_state(cpu); } --=20 1.8.3.1