[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 19/44] s390x/pci: Fix harmless mistake in zpci's property fid'
From: |
Markus Armbruster |
Subject: |
[PATCH v3 19/44] s390x/pci: Fix harmless mistake in zpci's property fid's setter |
Date: |
Mon, 6 Jul 2020 10:09:25 +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 v3 20/44] qom: Use error_reportf_err() instead of g_printerr() in examples, (continued)
- [PATCH v3 20/44] qom: Use error_reportf_err() instead of g_printerr() in examples, Markus Armbruster, 2020/07/06
- [PATCH v3 31/44] qdev: Use returned bool to check for failure, Coccinelle part, Markus Armbruster, 2020/07/06
- [PATCH v3 08/44] qemu-option: Factor out helper find_default_by_name(), Markus Armbruster, 2020/07/06
- [PATCH v3 23/44] qom: Don't handle impossible object_property_get_link() failure, Markus Armbruster, 2020/07/06
- [PATCH v3 38/44] qapi: Smooth another visitor error checking pattern, Markus Armbruster, 2020/07/06
- [PATCH v3 36/44] error: Reduce unnecessary error propagation, Markus Armbruster, 2020/07/06
- [PATCH v3 44/44] hmp: Ignore Error objects where the return value suffices, Markus Armbruster, 2020/07/06
- [PATCH v3 35/44] error: Eliminate error_propagate() manually, Markus Armbruster, 2020/07/06
- [PATCH v3 39/44] qapi: Smooth visitor error checking in generated code, Markus Armbruster, 2020/07/06
- [PATCH v3 19/44] s390x/pci: Fix harmless mistake in zpci's property fid's setter,
Markus Armbruster <=
- [PATCH v3 26/44] qom: Make functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/06
- [PATCH v3 34/44] error: Eliminate error_propagate() with Coccinelle, part 2, Markus Armbruster, 2020/07/06
- [PATCH v3 05/44] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize(), Markus Armbruster, 2020/07/06
- [PATCH v3 40/44] qapi: Purge error_propagate() from QAPI core, Markus Armbruster, 2020/07/06
- [PATCH v3 41/44] error: Avoid error_propagate() after migrate_add_blocker(), Markus Armbruster, 2020/07/06
- [PATCH v3 16/44] qapi: Make visitor functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/06
- [PATCH v3 32/44] error: Avoid unnecessary error_propagate() after error_setg(), Markus Armbruster, 2020/07/06
- [PATCH v3 25/44] qom: Put name parameter before value / visitor parameter, Markus Armbruster, 2020/07/06