[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.0 05/12] hw/i386/x86: Add missing error-propagation code
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.0 05/12] hw/i386/x86: Add missing error-propagation code |
Date: |
Wed, 25 Mar 2020 20:18:23 +0100 |
Patch created mechanically by running:
$ spatch \
--macro-file scripts/cocci-macro-file.h --include-headers \
--sp-file scripts/coccinelle/object_property_missing_error_propagate.cocci \
--keep-comments --smpl-spacing --in-place --dir hw
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/i386/x86.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 87b73fe33c..0a4865d4a9 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -103,13 +103,17 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState
*x86ms,
void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp)
{
Object *cpu = NULL;
Error *local_err = NULL;
cpu = object_new(MACHINE(x86ms)->cpu_type);
object_property_set_uint(cpu, apic_id, "apic-id", &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
object_property_set_bool(cpu, true, "realized", &local_err);
object_unref(cpu);
error_propagate(errp, local_err);
}
--
2.21.1
- [PATCH-for-5.0 00/12] hw: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 01/12] scripts/coccinelle: Add script to catch missing error_propagate() calls, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 02/12] hw/arm/bcm2835_peripherals: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 03/12] hw/arm/fsl-imx: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 04/12] hw/arm/stm32fx05_soc: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 05/12] hw/i386/x86: Add missing error-propagation code,
Philippe Mathieu-Daudé <=
- [PATCH-for-5.0 06/12] hw/dma/xilinx_axidma: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 07/12] hw/mips/cps: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25
- [PATCH-for-5.0 08/12] hw/mips/boston: Add missing error-propagation code, Philippe Mathieu-Daudé, 2020/03/25