[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.1 v3 06/23] hw/arm/msf2-soc: Add missing error-propagation
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.1 v3 06/23] hw/arm/msf2-soc: Add missing error-propagation code |
Date: |
Mon, 13 Apr 2020 00:41:27 +0200 |
Patch created mechanically by running:
$ spatch \
--macro-file scripts/cocci-macro-file.h --include-headers \
--sp-file scripts/coccinelle/use-error_propagate-in-realize.cocci \
--keep-comments --smpl-spacing --in-place --dir hw
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/arm/msf2-soc.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index e448b0ab74..7619e71cfa 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -93,7 +93,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error
**errp)
MemoryRegion *system_memory = get_system_memory();
memory_region_init_rom(&s->nvm, OBJECT(dev_soc), "MSF2.eNVM", s->envm_size,
- &error_fatal);
+ &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
/*
* On power-on, the eNVM region 0x60000000 is automatically
* remapped to the Cortex-M3 processor executable region
@@ -107,7 +111,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error
**errp)
memory_region_add_subregion(system_memory, 0, &s->nvm_alias);
memory_region_init_ram(&s->sram, NULL, "MSF2.eSRAM", s->esram_size,
- &error_fatal);
+ &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
memory_region_add_subregion(system_memory, SRAM_BASE_ADDRESS, &s->sram);
armv7m = DEVICE(&s->armv7m);
@@ -115,7 +123,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error
**errp)
qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
qdev_prop_set_bit(armv7m, "enable-bitband", true);
object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
- "memory", &error_abort);
+ "memory", &err);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
object_property_set_bool(OBJECT(&s->armv7m), true, "realized", &err);
if (err != NULL) {
error_propagate(errp, err);
@@ -184,8 +196,12 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error
**errp)
bus_name = g_strdup_printf("spi%d", i);
object_property_add_alias(OBJECT(s), bus_name,
OBJECT(&s->spi[i]), "spi",
- &error_abort);
+ &err);
g_free(bus_name);
+ if (err) {
+ error_propagate(errp, err);
+ return;
+ }
}
/* Below devices are not modelled yet. */
--
2.21.1
- [PATCH-for-5.1 v3 00/23] various: Fix error-propagation with Coccinelle scripts (part 2), Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 01/23] scripts/coccinelle: Catch missing error_propagate() calls in realize(), Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 02/23] hw/arm/fsl-imx: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 03/23] hw/arm/stm32f*05_soc: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 04/23] hw/arm/aspeed: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 05/23] hw/arm/allwinner-a10: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 06/23] hw/arm/msf2-soc: Add missing error-propagation code,
Philippe Mathieu-Daudé <=
- [PATCH-for-5.1 v3 07/23] hw/riscv/sifive: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 08/23] hw/arm/armv7m: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 09/23] hw/intc/arm_gicv3_its_kvm: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 11/23] hw/pci-host/pnv_phb3: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12
- [PATCH-for-5.1 v3 10/23] hw/microblaze/xlnx-zynqmp-pmu: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/04/12