aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-12-04 10:36:24 +0100
committerMarkus Armbruster <armbru@redhat.com>2019-12-18 08:36:15 +0100
commitd402c98396b69d088d33070794893f7de254cbab (patch)
tree2da1c5eeab8219744026ec9bd2b055518c33be20 /hw/intc
parent8ca63ba8c2b1ee6746d2c245d70d82e7f7ef6e46 (diff)
hw/intc/s390: Simplify error handling in kvm_s390_flic_realize()
Cc: Halil Pasic <pasic@linux.ibm.com> Cc: Cornelia Huck <cohuck@redhat.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Halil Pasic <pasic@linux.ibm.com> Message-Id: <20191204093625.14836-18-armbru@redhat.com>
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/s390_flic_kvm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
index 30d50c2369..dddd33ea61 100644
--- a/hw/intc/s390_flic_kvm.c
+++ b/hw/intc/s390_flic_kvm.c
@@ -586,16 +586,17 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)
KVM_S390_FLIC_GET_CLASS(dev)->parent_realize(dev, &err);
if (err) {
- goto fail;
+ error_propagate(errp, err);
+ return;
}
flic_state->fd = -1;
cd.type = KVM_DEV_TYPE_FLIC;
ret = kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &cd);
if (ret < 0) {
- error_setg_errno(&err, errno, "Creating the KVM device failed");
+ error_setg_errno(errp, errno, "Creating the KVM device failed");
trace_flic_create_device(errno);
- goto fail;
+ return;
}
flic_state->fd = cd.fd;
@@ -603,9 +604,6 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)
test_attr.group = KVM_DEV_FLIC_CLEAR_IO_IRQ;
flic_state->clear_io_supported = !ioctl(flic_state->fd,
KVM_HAS_DEVICE_ATTR, test_attr);
- return;
-fail:
- error_propagate(errp, err);
}
static void kvm_s390_flic_reset(DeviceState *dev)