aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2016-06-13 18:57:56 -0300
committerMarkus Armbruster <armbru@redhat.com>2016-06-20 16:38:13 +0200
commit621ff94d5074d88253a5818c6b9c4db718fbfc65 (patch)
tree471a14faadcea9b57a834801610e2079264e4920 /blockdev.c
parentda002526ac30f679b0c797b0d71102dcdf200fe6 (diff)
error: Remove NULL checks on error_propagate() calls
error_propagate() already ignores local_err==NULL, so there's no need to check it before calling. Coccinelle patch used to perform the changes added to scripts/coccinelle/error_propagate_null.cocci. Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1465855078-19435-2-git-send-email-ehabkost@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/blockdev.c b/blockdev.c
index c9a0068cd6..8f94f760a2 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3644,9 +3644,7 @@ void qmp_drive_mirror(const char *device, const char *target,
has_unmap, unmap,
&local_err);
bdrv_unref(target_bs);
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
out:
aio_context_release(aio_context);
}
@@ -3701,9 +3699,7 @@ void qmp_blockdev_mirror(const char *device, const char *target,
has_on_target_error, on_target_error,
true, true,
&local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
aio_context_release(aio_context);
}
@@ -3913,9 +3909,7 @@ void qmp_change_backing_file(const char *device,
if (ro) {
bdrv_reopen(image_bs, open_flags, &local_err);
- if (local_err) {
- error_propagate(errp, local_err); /* will preserve prior errp */
- }
+ error_propagate(errp, local_err);
}
out: