From nobody Sat Nov 23 18:09:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730297328102686.0577894848155; Wed, 30 Oct 2024 07:08:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t69MW-0003j9-RY; Wed, 30 Oct 2024 10:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69MT-0003i4-OD for qemu-devel@nongnu.org; Wed, 30 Oct 2024 10:07:49 -0400 Received: from mx.astralinux.ru ([89.232.161.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t69MR-0000HO-Ac for qemu-devel@nongnu.org; Wed, 30 Oct 2024 10:07:49 -0400 Received: from gca-yc-ruca-srv-mail05.astralinux.ru ([10.177.185.111] helo=new-mail.astralinux.ru) by mx.astralinux.ru with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t69M9-005S6o-6n; Wed, 30 Oct 2024 17:07:29 +0300 Received: from MBP-Anastasia.astralinux.ru (unknown [10.198.14.135]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4XdpqB6ks1z1c0mR; Wed, 30 Oct 2024 17:07:34 +0300 (MSK) From: Anastasia Belova To: "Dr. David Alan Gilbert" Cc: Anastasia Belova , qemu-devel@nongnu.org, sdl.qemu@linuxtesting.org Subject: [PATCH] monitor: fix cases in switch in memory_dump Date: Wed, 30 Oct 2024 17:06:51 +0300 Message-ID: <20241030140656.36540-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DrWeb-SpamScore: 0 X-DrWeb-SpamState: legit X-DrWeb-SpamDetail: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehuddgtddvucetufdoteggodetrfcurfhrohhfihhlvgemucfftfghgfeunecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheptehnrghsthgrshhirgcuuegvlhhovhgruceorggsvghlohhvrgesrghsthhrrghlihhnuhigrdhruheqnecuggftrfgrthhtvghrnhepffdvvdeuheevvdfgiedvuedvudetueelgfefheeifffgheetuddtgfevfedvieehnecuffhomhgrihhnpehlihhnuhigthgvshhtihhnghdrohhrghenucfkphepuddtrdduleekrddugedrudefheenucfrrghrrghmpehhvghlohepofeurfdqtehnrghsthgrshhirgdrrghsthhrrghlihhnuhigrdhruhdpihhnvghtpedutddrudelkedrudegrddufeehmeehfeekkedvpdhmrghilhhfrhhomheprggsvghlohhvrgesrghsthhrrghlihhnuhigrdhruhdpnhgspghrtghpthhtohepgedprhgtphhtthhopegurghvvgesthhrvggslhhighdrohhrghdprhgtphhtthhopegrsggvlhhovhgrsegrshhtrhgrlhhinhhugidrrhhupdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghdprhgtphhtthhopehsughlrdhqvghmuheslhhinhhugihtvghsthhinhhgrdhorhhgnecuffhrrdghvggsucetnhhtihhsphgrmhemucenucfvrghgshem X-DrWeb-SpamVersion: Dr.Web Antispam 1.0.8.202410220#1730287075 X-AntiVirus: Checked by Dr.Web [MailD: 11.1.19.2307031128, SE: 11.1.12.2210241838, Core engine: 7.00.65.05230, Virus records: 12230125, Updated: 2024-Oct-30 12:59:00 UTC] 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; Received-SPF: pass client-ip=89.232.161.68; envelope-from=abelova@astralinux.ru; helo=mx.astralinux.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1730297344534116600 Content-Type: text/plain; charset="utf-8" default case has no condition. So if it is placed higher that other cases, they are unreachable. Move dafult case down. Found by Linux Verification Center (linuxtesting.org) Signed-off-by: Anastasia Belova --- monitor/hmp-cmds-target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor/hmp-cmds-target.c b/monitor/hmp-cmds-target.c index ff01cf9d8d..eea8ca047b 100644 --- a/monitor/hmp-cmds-target.c +++ b/monitor/hmp-cmds-target.c @@ -189,7 +189,6 @@ static void memory_dump(Monitor *mon, int count, int fo= rmat, int wsize, i =3D 0; while (i < l) { switch(wsize) { - default: case 1: v =3D ldub_p(buf + i); break; @@ -202,6 +201,9 @@ static void memory_dump(Monitor *mon, int count, int fo= rmat, int wsize, case 8: v =3D ldq_p(buf + i); break; + default: + v =3D ldub_p(buf + i); + break; } monitor_printf(mon, " "); switch(format) { --=20 2.47.0