[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/18] s390x/event-facility: Fix realize() error API violation
From: |
Markus Armbruster |
Subject: |
[PATCH v2 11/18] s390x/event-facility: Fix realize() error API violations |
Date: |
Wed, 4 Dec 2019 10:36:18 +0100 |
sclp_events_bus_realize() dereferences @errp when
object_property_set_bool() fails. That's wrong; see the big comment
in error.h. Introduced in commit f6102c329c "s390/sclp: rework sclp
event facility initialization + device realization".
No caller actually passes null.
Fix anyway: splice in a local Error *err, and error_propagate().
Cc: David Hildenbrand <address@hidden>
Cc: Cornelia Huck <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
---
hw/s390x/event-facility.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 66205697ae..cdcf9154c4 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -339,14 +339,16 @@ out:
static void sclp_events_bus_realize(BusState *bus, Error **errp)
{
+ Error *err = NULL;
BusChild *kid;
/* TODO: recursive realization has to be done in common code */
QTAILQ_FOREACH(kid, &bus->children, sibling) {
DeviceState *dev = kid->child;
- object_property_set_bool(OBJECT(dev), true, "realized", errp);
- if (*errp) {
+ object_property_set_bool(OBJECT(dev), true, "realized", &err);
+ if (errp) {
+ error_propagate(errp, err);
return;
}
}
--
2.21.0
- [PATCH v2 00/18] Error handling fixes, Markus Armbruster, 2019/12/04
- [PATCH v2 09/18] qga: Fix guest-get-fsinfo error API violations, Markus Armbruster, 2019/12/04
- [PATCH v2 02/18] crypto: Fix typo in QCryptoTLSSession's <example> comment, Markus Armbruster, 2019/12/04
- [PATCH v2 04/18] tests: Clean up initialization of Error *err variables, Markus Armbruster, 2019/12/04
- [PATCH v2 11/18] s390x/event-facility: Fix realize() error API violations,
Markus Armbruster <=
- [PATCH v2 13/18] s390x/cpumodel: Fix realize() error API violations, Markus Armbruster, 2019/12/04
- [PATCH v2 08/18] hw/ipmi: Fix realize() error API violations, Markus Armbruster, 2019/12/04
- [PATCH v2 05/18] exec: Fix file_ram_alloc() error API violations, Markus Armbruster, 2019/12/04
- [PATCH v2 17/18] hw/intc/s390: Simplify error handling in kvm_s390_flic_realize(), Markus Armbruster, 2019/12/04
- [PATCH v2 01/18] crypto: Fix certificate file error handling crash bug, Markus Armbruster, 2019/12/04
- [PATCH v2 07/18] hw/core: Fix fit_load_fdt() error handling violations, Markus Armbruster, 2019/12/04
- [PATCH v2 03/18] io: Fix Error usage in a comment <example>, Markus Armbruster, 2019/12/04