From: Auger Eric <eric.auger@redhat.com>
To: Peng Hao <peng.hao2@zte.com.cn>, peter.maydell@linaro.org
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: fix assert in match function
Date: Sat, 17 Nov 2018 17:10:00 +0100 [thread overview]
Message-ID: <5fb48e39-d91b-6750-975b-ea58575ade92@redhat.com> (raw)
In-Reply-To: <1542482566-91660-1-git-send-email-peng.hao2@zte.com.cn>
Hi Peng,
On 11/17/18 8:22 PM, Peng Hao wrote:
> In match function it should not call OBJECK_CHECK. When there is
> a mismatch, we should continue to match rather than assert().
Normally this issue should have been fixed by
e9ac8e84f0 "hw/arm/sysbus-fdt: Only call match_fn callback if the type
matches". Please can you confirm?
Thanks
Eric
>
> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
> hw/arm/sysbus-fdt.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c
> index 0e24c80..41b962d 100644
> --- a/hw/arm/sysbus-fdt.c
> +++ b/hw/arm/sysbus-fdt.c
> @@ -419,10 +419,15 @@ static int add_amd_xgbe_fdt_node(SysBusDevice *sbdev, void *opaque)
> static bool vfio_platform_match(SysBusDevice *sbdev,
> const BindingEntry *entry)
> {
> - VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev);
> + VFIOPlatformDevice *vdev;
> const char *compat;
> unsigned int n;
>
> + vdev = (VFIOPlatformDevice *) object_dynamic_cast(OBJECT(sbdev),
> + TYPE_VFIO_PLATFORM);
> + if (!vdev)
> + return false;
> +
> for (n = vdev->num_compat, compat = vdev->compat; n > 0;
> n--, compat += strlen(compat) + 1) {
> if (!strcmp(entry->compat, compat)) {
>
next prev parent reply other threads:[~2018-11-17 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-17 19:22 [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: fix assert in match function Peng Hao
2018-11-17 16:10 ` Auger Eric [this message]
2018-11-19 13:10 ` [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: fix assert in matchfunction peng.hao2
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=5fb48e39-d91b-6750-975b-ea58575ade92@redhat.com \
--to=eric.auger@redhat.com \
--cc=peng.hao2@zte.com.cn \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--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).