From: Zhao Liu <zhao1.liu@linux.intel.com>
To: "Michael S . Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH] hw/intc: Handle the error of IOAPICCommonClass.realize()
Date: Wed, 31 Jan 2024 22:29:02 +0800 [thread overview]
Message-ID: <20240131142902.115964-1-zhao1.liu@linux.intel.com> (raw)
From: Zhao Liu <zhao1.liu@intel.com>
IOAPICCommonClass implements its own private realize(), and this private
realize() allows error.
Therefore, return directly if IOAPICCommonClass.realize() meets error.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/intc/ioapic_common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index cb9bf6214608..3772863377c2 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -162,6 +162,9 @@ static void ioapic_common_realize(DeviceState *dev, Error **errp)
info = IOAPIC_COMMON_GET_CLASS(s);
info->realize(dev, errp);
+ if (*errp) {
+ return;
+ }
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->io_memory);
ioapic_no++;
--
2.34.1
next reply other threads:[~2024-01-31 14:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 14:29 Zhao Liu [this message]
2024-01-31 16:48 ` [PATCH] hw/intc: Handle the error of IOAPICCommonClass.realize() Philippe Mathieu-Daudé
2024-02-01 3:25 ` Zhao Liu
2024-02-06 16:08 ` Zhao Liu
2024-02-07 6:51 ` Markus Armbruster
2024-02-07 16:37 ` Zhao Liu
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=20240131142902.115964-1-zhao1.liu@linux.intel.com \
--to=zhao1.liu@linux.intel.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=zhao1.liu@intel.com \
/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).