[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 20/44] s390x/pci: Fix harmless mistake in zpci's property fid'
From: |
Markus Armbruster |
Subject: |
[PATCH v2 20/44] s390x/pci: Fix harmless mistake in zpci's property fid's setter |
Date: |
Thu, 2 Jul 2020 17:49:36 +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>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@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 0517901024..07e1e4d7a3 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -1267,7 +1267,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 v2 04/44] macio: Tidy up error handling in macio_newworld_realize(), (continued)
- [PATCH v2 04/44] macio: Tidy up error handling in macio_newworld_realize(), Markus Armbruster, 2020/07/02
- [PATCH v2 09/44] qemu-option: Simplify around find_default_by_name(), Markus Armbruster, 2020/07/02
- [PATCH v2 05/44] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize(), Markus Armbruster, 2020/07/02
- [PATCH v2 11/44] qemu-option: Replace opt_set() by cleaner opt_validate(), Markus Armbruster, 2020/07/02
- [PATCH v2 15/44] hmp: Eliminate a variable in hmp_migrate_set_parameter(), Markus Armbruster, 2020/07/02
- [PATCH v2 08/44] qemu-option: Factor out helper find_default_by_name(), Markus Armbruster, 2020/07/02
- [PATCH v2 24/44] qom: Don't handle impossible object_property_get_link() failure, Markus Armbruster, 2020/07/02
- [PATCH v2 27/44] qom: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/02
- [PATCH v2 20/44] s390x/pci: Fix harmless mistake in zpci's property fid's setter,
Markus Armbruster <=
- [PATCH v2 23/44] qom: Crash more nicely on object_property_get_link() failure, Markus Armbruster, 2020/07/02
- [PATCH v2 14/44] block: Avoid error accumulation in bdrv_img_create(), Markus Armbruster, 2020/07/02
- [PATCH v2 12/44] qemu-option: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/02
- [PATCH v2 30/44] qom: Make functions taking Error ** return bool, not 0/-1, Markus Armbruster, 2020/07/02