mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qom: Crash more nicely on object_property_get_link() failure
Pass &error_abort instead of NULL where the returned value is dereferenced or asserted to be non-null. Drop a now redundant assertion. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20200707160613.848843-24-armbru@redhat.com>
This commit is contained in:
parent
90c69fb9fd
commit
552d7f49ee
5 changed files with 10 additions and 7 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "qemu/osdep.h"
|
||||
#include "hw/platform-bus.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/module.h"
|
||||
|
||||
|
@ -63,9 +64,8 @@ hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
|
|||
return -1;
|
||||
}
|
||||
|
||||
parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container", NULL);
|
||||
|
||||
assert(parent_mr);
|
||||
parent_mr = object_property_get_link(OBJECT(sbdev_mr), "container",
|
||||
&error_abort);
|
||||
if (parent_mr != pbus_mr_obj) {
|
||||
/* MMIO region is not mapped on platform bus */
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue