From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Bernhard Beschow" <shentey@gmail.com>,
qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v3 1/3] hw/arm/imx8mp-evk: Fix reference count of SoC object
Date: Tue, 18 Mar 2025 21:57:07 +0100 [thread overview]
Message-ID: <20250318205709.28862-2-shentey@gmail.com> (raw)
In-Reply-To: <20250318205709.28862-1-shentey@gmail.com>
TYPE_FSL_IMX8MP is created using object_new(), so must be realized with
qdev_realize_and_unref() to keep the reference counting intact.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/arm/imx8mp-evk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
index e1a7892fd7..e1a21e52f9 100644
--- a/hw/arm/imx8mp-evk.c
+++ b/hw/arm/imx8mp-evk.c
@@ -37,7 +37,7 @@ static void imx8mp_evk_init(MachineState *machine)
s = FSL_IMX8MP(object_new(TYPE_FSL_IMX8MP));
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
object_property_set_uint(OBJECT(s), "fec1-phy-num", 1, &error_fatal);
- qdev_realize(DEVICE(s), NULL, &error_fatal);
+ qdev_realize_and_unref(DEVICE(s), NULL, &error_fatal);
memory_region_add_subregion(get_system_memory(), FSL_IMX8MP_RAM_START,
machine->ram);
--
2.49.0
next prev parent reply other threads:[~2025-03-18 20:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 20:57 [PATCH v3 0/3] i.MX 8M Plus EVK Fixes Bernhard Beschow
2025-03-18 20:57 ` Bernhard Beschow [this message]
2025-03-19 16:51 ` [PATCH v3 1/3] hw/arm/imx8mp-evk: Fix reference count of SoC object Bernhard Beschow
2025-03-19 18:06 ` Peter Maydell
2025-03-26 17:54 ` Bernhard Beschow
2025-03-18 20:57 ` [PATCH v3 2/3] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE Bernhard Beschow
2025-03-18 20:57 ` [PATCH v3 3/3] hw/arm/fsl-imx8mp: Remove unused define Bernhard Beschow
2025-03-27 16:19 ` [PATCH v3 0/3] i.MX 8M Plus EVK Fixes Philippe Mathieu-Daudé
2025-03-30 9:48 ` Bernhard Beschow
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=20250318205709.28862-2-shentey@gmail.com \
--to=shentey@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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).