qemu/hw/nubus
Zhao Liu 2f28f28e74 hw/nubus/virtio-mmio: Fix missing ERRP_GUARD() in realize handler
According to the comment in qapi/error.h, dereferencing @errp requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
* - It must not be dereferenced, because it may be null.
...
* ERRP_GUARD() lifts these restrictions.
*
* To use ERRP_GUARD(), add it right at the beginning of the function.
* @errp can then be used without worrying about the argument being
* NULL or &error_fatal.
*
* Using it when it's not needed is safe, but please avoid cluttering
* the source with useless code.

In nubus_virtio_mmio_realize(), @errp is dereferenced without
ERRP_GUARD().

Although nubus_virtio_mmio_realize() - as a DeviceClass.realize()
method - is never passed a null @errp argument, it should follow the
rules on @errp usage.  Add the ERRP_GUARD() there.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240723161802.1377985-1-zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-07-23 22:34:09 +02:00
..
Kconfig hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
mac-nubus-bridge.c nubus-bridge: embed the NubusBus object directly within nubus-bridge 2021-09-29 10:45:19 +02:00
meson.build hw/nubus: add nubus-virtio-mmio device 2024-02-27 09:36:39 +01:00
nubus-bridge.c qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
nubus-bus.c nubus: move nubus to its own 32-bit address space 2021-09-29 10:45:19 +02:00
nubus-device.c hw/nubus-device: round Declaration ROM memory region address to qemu_target_page_size() 2024-02-27 09:36:25 +01:00
nubus-virtio-mmio.c hw/nubus/virtio-mmio: Fix missing ERRP_GUARD() in realize handler 2024-07-23 22:34:09 +02:00
trace-events trace-events: Fix the name of the tracing.rst file 2023-09-08 13:08:51 +03:00
trace.h nubus: add trace-events for empty slot accesses 2021-09-29 10:45:19 +02:00