]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
migration: Remove unneeded NULL check from migrate_fd_error()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 21 Oct 2016 17:41:45 +0000 (18:41 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 28 Oct 2016 15:17:23 +0000 (18:17 +0300)
All the callers of migrate_fd_error() pass a non-NULL
error parameter, and if any did pass NULL then we would
segfault in error_copy(), so remove the unnecessary
NULL check earlier in the function.
(Spotted by Coverity.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
migration/migration.c

index 4d417b76cf8792f86d1998bea0034fea0037b856..d216b93bfd6dc2fbdfeb7e691c83b8e92f8caf80 100644 (file)
@@ -922,7 +922,7 @@ static void migrate_fd_cleanup(void *opaque)
 
 void migrate_fd_error(MigrationState *s, const Error *error)
 {
-    trace_migrate_fd_error(error ? error_get_pretty(error) : "");
+    trace_migrate_fd_error(error_get_pretty(error));
     assert(s->to_dst_file == NULL);
     migrate_set_state(&s->state, MIGRATION_STATUS_SETUP,
                       MIGRATION_STATUS_FAILED);