From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxdpH-0004c2-4c for qemu-devel@nongnu.org; Fri, 21 Oct 2016 13:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxdpG-0001Je-E5 for qemu-devel@nongnu.org; Fri, 21 Oct 2016 13:41:51 -0400 From: Peter Maydell Date: Fri, 21 Oct 2016 18:41:45 +0100 Message-Id: <1477071705-30634-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] migration: Remove unneeded NULL check from migrate_fd_error() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: patches@linaro.org, Juan Quintela , Amit Shah 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 --- This seems better than making migrate_fd_error() allow a NULL pointer, which doesn't seem like a useful thing. I'm guessing a bit though, because there's no doc comment for this function in the header file... --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 4d417b7..d216b93 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); -- 2.7.4