From: Anastasia Belova <abelova@astralinux.ru>
To: "Dr. David Alan Gilbert" <dave@treblig.org>
Cc: Anastasia Belova <abelova@astralinux.ru>,
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 [thread overview]
Message-ID: <20241030140656.36540-1-abelova@astralinux.ru> (raw)
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 <abelova@astralinux.ru>
---
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 format, int wsize,
i = 0;
while (i < l) {
switch(wsize) {
- default:
case 1:
v = ldub_p(buf + i);
break;
@@ -202,6 +201,9 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
case 8:
v = ldq_p(buf + i);
break;
+ default:
+ v = ldub_p(buf + i);
+ break;
}
monitor_printf(mon, " ");
switch(format) {
--
2.47.0
next reply other threads:[~2024-10-30 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 14:06 Anastasia Belova [this message]
2024-10-30 19:03 ` [PATCH] monitor: fix cases in switch in memory_dump Phil Dennis-Jordan
2024-10-31 0:31 ` Dr. David Alan Gilbert
2024-10-31 10:52 ` Peter Maydell
2024-10-31 11:26 ` Peter Maydell
2024-10-31 11:26 ` Anastasia Belova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241030140656.36540-1-abelova@astralinux.ru \
--to=abelova@astralinux.ru \
--cc=dave@treblig.org \
--cc=qemu-devel@nongnu.org \
--cc=sdl.qemu@linuxtesting.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).