[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/53] s390x/pci: Fix harmless mistake in zpci's property fid's se
From: |
Markus Armbruster |
Subject: |
[PULL 20/53] s390x/pci: Fix harmless mistake in zpci's property fid's setter |
Date: |
Tue, 7 Jul 2020 23:24:30 +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>
Message-Id: <20200707160613.848843-21-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 9e6b170fa8..1e4537f0e3 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -1269,7 +1269,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
- [PULL 18/53] qapi: Use returned bool to check for failure, Coccinelle part, (continued)
- [PULL 18/53] qapi: Use returned bool to check for failure, Coccinelle part, Markus Armbruster, 2020/07/08
- [PULL 12/53] qemu-option: Replace opt_set() by cleaner opt_validate(), Markus Armbruster, 2020/07/08
- [PULL 01/53] error: Fix examples in error.h's big comment, Markus Armbruster, 2020/07/08
- [PULL 10/53] qemu-option: Simplify around find_default_by_name(), Markus Armbruster, 2020/07/08
- [PULL 17/53] qapi: Make visitor functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/08
- [PULL 37/53] error: Reduce unnecessary error propagation, Markus Armbruster, 2020/07/08
- [PULL 15/53] block: Avoid error accumulation in bdrv_img_create(), Markus Armbruster, 2020/07/08
- [PULL 48/53] sd: Use ERRP_GUARD(), Markus Armbruster, 2020/07/08
- [PULL 14/53] qemu-option: Use returned bool to check for failure, Markus Armbruster, 2020/07/08
- [PULL 21/53] qom: Use error_reportf_err() instead of g_printerr() in examples, Markus Armbruster, 2020/07/08
- [PULL 20/53] s390x/pci: Fix harmless mistake in zpci's property fid's setter,
Markus Armbruster <=
- [PULL 29/53] qom: Use returned bool to check for failure, manual part, Markus Armbruster, 2020/07/08
- [PULL 03/53] error: Document Error API usage rules, Markus Armbruster, 2020/07/08
- Re: [PULL 00/53] Error reporting patches patches for 2020-07-07, Markus Armbruster, 2020/07/10