diff --git a/blockdev.c b/blockdev.c index e6c83494092856d2a2a499f256894dcbb66bb0da..a6f71f9d83ba99741c42bb31f010889edc16c6b3 100644 --- a/blockdev.c +++ b/blockdev.c @@ -992,9 +992,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type, blk = blockdev_init(filename, bs_opts, &local_err); bs_opts = NULL; if (!blk) { - if (local_err) { - error_propagate(errp, local_err); - } + error_propagate(errp, local_err); goto fail; } else { assert(!local_err); diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 99d0368868254f6be6ead752fa55b06e414e5260..f7458445c0f50a7ebf85944286433abd0c007170 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -731,9 +731,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp) css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false, S390_ADAPTER_SUPPRESSIBLE, &local_err); - if (local_err) { - error_propagate(errp, local_err); - } + error_propagate(errp, local_err); } static int s390_pci_msix_init(S390PCIBusDevice *pbdev) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 1877976522773231b040bdc311380b98ec472a06..2e719d9b6b9620499d7df2d19e2cf4c3a7f1034b 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -1573,10 +1573,7 @@ static bool systemd_supports_mode(SuspendMode mode, Error **errp) return true; } - if (local_err) { - error_propagate(errp, local_err); - } - + error_propagate(errp, local_err); return false; } @@ -1782,7 +1779,7 @@ static void guest_suspend(SuspendMode mode, Error **errp) if (!mode_supported) { error_setg(errp, "the requested suspend mode is not supported by the guest"); - } else if (local_err) { + } else { error_propagate(errp, local_err); } }