[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: fix assert in match function
From: |
Auger Eric |
Subject: |
Re: [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: fix assert in match function |
Date: |
Sat, 17 Nov 2018 17:10:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
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 <address@hidden>
> ---
> 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)) {
>