From: Peter Maydell Date: Fri, 21 Oct 2016 17:41:45 +0000 (+0100) Subject: migration: Remove unneeded NULL check from migrate_fd_error() X-Git-Tag: v2.8.0-rc0~46^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25174055f428254427e7541139037eb9a34fc109;p=thirdparty%2Fqemu.git migration: Remove unneeded NULL check from migrate_fd_error() 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 Signed-off-by: Michael Tokarev --- diff --git a/migration/migration.c b/migration/migration.c index 4d417b76cf8..d216b93bfd6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -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);