From: Zheng Huang <hz1624917200@gmail.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] hw/audio/cs4231a: fix assertion error in isa_bus_get_irq
Date: Fri, 9 May 2025 19:15:29 +0800 [thread overview]
Message-ID: <b18184b6-aa78-4b81-b2af-96a5628f122b@gmail.com> (raw)
This patch fixes an assertion error in isa_bus_get_irq() in
/hw/isa/isa-bus.c by adding a constraint to the irq property.
Signed-off-by: Zheng Huang <hz1624917200@gmail.com>
---
hw/audio/cs4231a.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 5a9be80ba3..d390da4c37 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -682,6 +682,10 @@ static void cs4231a_realizefn (DeviceState *dev, Error **errp)
return;
}
+ if (s->irq >= ISA_NUM_IRQS) {
+ error_setg(errp, "Invalid IRQ %d (max %d)", s->irq, ISA_NUM_IRQS);
+ return;
+ }
s->pic = isa_bus_get_irq(bus, s->irq);
k = ISADMA_GET_CLASS(s->isa_dma);
k->register_channel(s->isa_dma, s->dma, cs_dma_read, s);
--
2.34.1
next reply other threads:[~2025-05-09 11:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 11:15 Zheng Huang [this message]
2025-05-09 11:28 ` [PATCH] hw/audio/cs4231a: fix assertion error in isa_bus_get_irq Philippe Mathieu-Daudé
2025-05-09 11:37 ` Zheng Huang
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=b18184b6-aa78-4b81-b2af-96a5628f122b@gmail.com \
--to=hz1624917200@gmail.com \
--cc=qemu-devel@nongnu.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).