s390x/pci: Fix harmless mistake in zpci's property fid's setter

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>
This commit is contained in:
Markus Armbruster 2020-07-07 18:05:48 +02:00
parent 14217038bc
commit 5af3a05631
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}