error: Remove NULL checks on error_propagate() calls

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Whitespace tidied up manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181213173113.11211-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Markus Armbruster 2018-12-13 18:31:13 +01:00 committed by Laurent Vivier
parent 92917cd251
commit b2322003b6
3 changed files with 4 additions and 11 deletions

View File

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

View File

@ -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)

View File

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