[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 30/46] s390x/pci: Fix harmless mistake in zpci's property fid's s
From: |
Markus Armbruster |
Subject: |
[PATCH 30/46] s390x/pci: Fix harmless mistake in zpci's property fid's setter |
Date: |
Wed, 24 Jun 2020 18:43:28 +0200 |
s390_pci_set_fid() sets zpci->fid_defined to true even when
visit_type_uint32() failed. Reproducer: "-device zpci,fid=junk".
Harmless in practice, because qdev_device_add() then fails, throwing
away @zpci. Fix it anyway.
Cc: Matthew Rosato <mjrosato@linux.ibm.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/s390x/s390-pci-bus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index be8535304e..2e0eab1c69 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -1265,7 +1265,9 @@ static void s390_pci_set_fid(Object *obj, Visitor *v,
const char *name,
return;
}
- visit_type_uint32(v, name, ptr, errp);
+ if (!visit_type_uint32(v, name, ptr, errp)) {
+ return;
+ }
zpci->fid_defined = true;
}
--
2.26.2
- [PATCH 27/46] qapi: Purge error_propagate() from QAPI core, (continued)
- [PATCH 27/46] qapi: Purge error_propagate() from QAPI core, Markus Armbruster, 2020/06/24
- [PATCH 33/46] qom: Crash more nicely on object_property_get_link() failure, Markus Armbruster, 2020/06/24
- [PATCH 25/46] qapi: Smooth visitor error checking in generated code, Markus Armbruster, 2020/06/24
- [PATCH 23/46] qapi: Smooth error checking with Coccinelle, Markus Armbruster, 2020/06/24
- [PATCH 30/46] s390x/pci: Fix harmless mistake in zpci's property fid's setter,
Markus Armbruster <=
- [PATCH 37/46] qom: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/06/24
- [PATCH 26/46] qapi: Smooth another visitor error checking pattern, Markus Armbruster, 2020/06/24
- [PATCH 24/46] qapi: Smooth error checking manually, Markus Armbruster, 2020/06/24
- [PATCH 17/46] qemu-option: Smooth error checking with Coccinelle, Markus Armbruster, 2020/06/24