qemu-e2k/hw/misc
Zhao Liu b691b250d3 hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend()
As the comment in qapi/error, passing @errp to error_prepend() requires
ERRP_GUARD():

* = Why, when and how to use ERRP_GUARD() =
*
* Without ERRP_GUARD(), use of the @errp parameter is restricted:
...
* - It should not be passed to error_prepend(), error_vprepend() or
*   error_append_hint(), because that doesn't work with &error_fatal.
* 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.

ERRP_GUARD() could avoid the case when @errp is &error_fatal, the user
can't see this additional information, because exit() happens in
error_setg earlier than information is added [1].

The ivshmem_common_realize() passes @errp to error_prepend(), and as a
DeviceClass.realize method, there are too many possible callers to check
the impact of this defect; it may or may not be harmless. Thus it is
necessary to protect @errp with ERRP_GUARD().

To avoid the issue like [1] said, add missing ERRP_GUARD() at the
beginning of this function.

[1]: Issue description in the commit message of commit ae7c80a7bd
     ("error: New macro ERRP_GUARD()").

Cc: Juan Quintela <quintela@trasno.org>
Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: Michael Galaxy <mgalaxy@akamai.com>
Cc: Steve Sistare <steven.sistare@oracle.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-ID: <20240311033822.3142585-17-zhao1.liu@linux.intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-03-11 22:10:18 +01:00
..
macio hw/misc/macio: Realize IDE controller before accessing it 2024-02-15 16:58:46 +01:00
a9scu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-a10-ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-a10-dramc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-cpucfg.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-h3-ccu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-h3-dramc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-h3-sysctrl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-r40-ccu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-r40-dramc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-sid.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
allwinner-sramc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
applesmc.c Do not include "qemu/error-report.h" in headers that do not need it 2023-02-14 09:11:27 +01:00
arm11scu.c
arm_integrator_debug.c
arm_l2x0.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
arm_sysctl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
armsse-cpu-pwrctrl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
armsse-cpuid.c
armsse-mhu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
armv7m_ras.c
aspeed_hace.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_i3c.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_lpc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_peci.c
aspeed_sbc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_scu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_sdmc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
aspeed_xdma.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
auxbus.c
avr_power.c
axp2xx.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_cprman.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_mbox.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_mphi.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_powermgt.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_property.c hw/misc/bcm2835_property: Add missed BCM2835 properties 2024-02-27 15:24:20 +00:00
bcm2835_rng.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
bcm2835_thermal.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
cbus.c
debugexit.c
djmemc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
eccmemctl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
edu.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 2024-01-08 10:45:43 -05:00
empty_slot.c
exynos4210_clk.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
exynos4210_pmu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
exynos4210_rng.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
grlib_ahb_apb_pnp.c
i2c-echo.c hw/misc/i2c-echo: add copyright/license note 2023-10-12 14:11:44 +02:00
imx6_ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx6_src.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 2024-01-08 10:45:43 -05:00
imx6ul_ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx7_ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx7_gpr.c
imx7_snvs.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx7_src.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 2024-01-08 10:45:43 -05:00
imx25_ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx31_ccm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
imx_ccm.c
imx_rngc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
iosb.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
iotkit-secctl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
iotkit-sysctl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
iotkit-sysinfo.c
ivshmem.c hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend() 2024-03-11 22:10:18 +01:00
Kconfig hw/misc/stm32l4x5_rcc: Implement STM32L4x5_RCC skeleton 2024-03-05 13:22:55 +00:00
lasi.c lasi: Add reset I/O ports for LASI audio and FDC 2024-02-11 13:20:23 +01:00
led.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mac_via.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mchp_pfsoc_dmc.c
mchp_pfsoc_ioscb.c
mchp_pfsoc_sysreg.c
meson.build hw/misc/stm32l4x5_rcc: Implement STM32L4x5_RCC skeleton 2024-03-05 13:22:55 +00:00
mips_cmgcr.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mips_cpc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mips_itu.c hw/misc/mips_itu: Remove MIPSITUState::saar field 2024-02-15 15:53:12 +01:00
mos6522.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mps2-fpgaio.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mps2-scc.c hw/misc/mps2-scc: Make changes needed for AN536 FPGA image 2024-02-15 14:32:38 +00:00
msf2-sysreg.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
mst_fpga.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
npcm7xx_clk.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
npcm7xx_gcr.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
npcm7xx_mft.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
npcm7xx_pwm.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
npcm7xx_rng.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
nrf51_rng.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
omap_clk.c
omap_gpmc.c
omap_l4.c
omap_sdrc.c
omap_tap.c
pc-testdev.c
pca9552.c misc/pca9552: Let external devices set pca9552 inputs 2024-02-23 23:24:42 +10:00
pca9554.c misc: Add a pca9554 GPIO device model 2024-02-23 23:24:42 +10:00
pci-testdev.c kvm: require KVM_CAP_IOEVENTFD and KVM_CAP_IOEVENTFD_ANY_LENGTH 2023-10-25 17:35:15 +02:00
pvpanic-isa.c
pvpanic-pci.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
pvpanic.c
sbsa_ec.c
sifive_e_aon.c hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b. 2023-07-10 22:29:14 +10:00
sifive_e_prci.c
sifive_test.c hw/misc/sifive_test.c: replace exit calls with proper shutdown 2023-10-12 12:34:30 +10:00
sifive_u_otp.c
sifive_u_prci.c
slavio_misc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
stm32f2xx_syscfg.c hw/other: spelling fixes 2023-09-21 11:31:16 +03:00
stm32f4xx_exti.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
stm32f4xx_syscfg.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
stm32l4x5_exti.c hw/misc: Implement STM32L4x5 EXTI 2024-01-15 17:12:22 +00:00
stm32l4x5_rcc.c hw/misc/stm32l4x5_rcc: Add write protections to CR register 2024-03-05 13:22:56 +00:00
stm32l4x5_syscfg.c hw/arm: Connect STM32L4x5 GPIO to STM32L4x5 SoC 2024-03-07 12:19:25 +00:00
trace-events hw/misc/stm32l4x5_rcc: Add an internal PLL Clock object 2024-03-05 13:22:56 +00:00
trace.h
tz-mpc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
tz-msc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
tz-ppc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
unimp.c
virt_ctrl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
vmcoreinfo.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-cfi-if.c hw/misc: Introduce the Xilinx CFI interface 2023-09-08 16:41:34 +01:00
xlnx-versal-cframe-reg.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-versal-cfu.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-versal-crl.c hw/misc/xlnx-versal-crl: Build it only once 2024-01-26 11:30:49 +00:00
xlnx-versal-pmc-iou-slcr.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-versal-trng.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-versal-xramc.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-zynqmp-apu-ctrl.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
xlnx-zynqmp-crf.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00
zynq_slcr.c hw/misc: Constify VMState 2023-12-30 07:38:06 +11:00