From nobody Thu Nov 13 03:23:39 2025 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=1576515349; cv=none; d=zohomail.com; s=zohoarc; b=k09HmDli0jdwhyBj452WZxdYXT1zZjKUvic10M3DbfvvHAy4sw1INc0YFb293Uj7GXdvtskkdNJrhKGozcgautRTOIH6Ei1uuHIWxhId1K3+yYUUZwCkBEtLkBUA7w3X7a6ofI346yrRBk9KeB/deL/ow1dC1wTNPbO81tLQjqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576515349; 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=O9wztjBnbF8RxqlFCcyYsQX4jMH0+ww69uPWnQl6x1oWaf/OHCl3faPFrH+68jg3zxc7SjZCUAhj7xPj2yvy8U3uZVmQDZ9c1r/BjgDmRiRpr8fku8EvJF2L8KRMr0pqEywO9iew0oTlbwK1hY/xpY25lTYdgtbn2ZFQsvYET08= 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 157651534927323.831275632167717; Mon, 16 Dec 2019 08:55:49 -0800 (PST) Received: from localhost ([::1]:56894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtet-0003iV-JN for importer@patchew.org; Mon, 16 Dec 2019 11:55:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57052) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtFM-0005PX-R9 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtFL-00083d-Ox for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:24 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igtFL-00081g-Ih for qemu-devel@nongnu.org; Mon, 16 Dec 2019 11:29:23 -0500 Received: by mail-wr1-x42f.google.com with SMTP id c14so8051676wrn.7 for ; Mon, 16 Dec 2019 08:29:23 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id q68sm19962334wme.14.2019.12.16.08.29.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 08:29:21 -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=DaEHl6Dsqm8hqfm/jR7fBK2BgKP4aL4GewQe8VRKGq9TnVDAijwRqRS+U3cErGC5AV H2Tj8sSg4aLxQibYzclCtybH6sI3zYF1wZicKkIA0X1SlsgUcIKwg3k4CtG52Mie+nHu NMjuNS5lsZ5q6vROnGXcuNJY3FQ9FYSby/LIVEH2KzX6r22BfxA71aFdqtd/WkUbv4pa /LNs+VqYtMH6wzsC4FCj7Ax8XaFPTpZCqJ7dZ72v/6DulSSilCUDkTO/33ri83cfPrMF eNqK5CnkeqHFMUfznnP90BmZW+5I6CqTo3JuwW19CiYNXL/qKo/Clgtoi4PufFWGIV2Z r+fA== 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=rR9c3pmLQr9+8ie4EMybFmweIgyE+0GoQxhXEgX1t8R1HbqSY7tbxZiXuhcxKhQmN7 6gW6OwbW2wI2C9/QY/WKFk52IVSejitIXmSkF1PePMYWCFMmBRB8NzY/DPNeA17r2V1e c5sE2ISiJPHBwjRQSp7EquWZ+pcfgBxUeLs8S0i5op62UC6i7dwjagtO69ExzPTJ3frn lmwuvKJeOUUxgb9oYMuq+9dZOeMQN2VHGbQuxYRkATYa+gkMw6SDq6A1Tf5Oxf6F2356 ur1G90s/40anwrTOwBpunsC7Whf/x4bPkp/B5VzKP1kdvq7KpR7ip3xGF0rbJ67CKXx6 ZSMw== X-Gm-Message-State: APjAAAXvft40KR1/qqgfJoH6PwHr0SxJ+gYgRzk9u8L8y73ORER0m+H+ PNhe+o/N80ua+UpQGIzbHiOnY1DY X-Google-Smtp-Source: APXvYqzZL9J/EAk7mMIH+jiTbjn8r/Z25M/xhwObmbxfiCjduNR6n+peidQdfEVUqlEgHUCNmy5S3A== X-Received: by 2002:a5d:53c1:: with SMTP id a1mr30044589wrw.373.1576513762427; Mon, 16 Dec 2019 08:29:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 35/62] monitor: fix maybe-uninitialized Date: Mon, 16 Dec 2019 17:28:19 +0100 Message-Id: <1576513726-53700-36-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576513726-53700-1-git-send-email-pbonzini@redhat.com> References: <1576513726-53700-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::42f 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