diff mbox

[PULL,16/23] migration: Remove unneeded NULL check from migrate_fd_error()

Message ID 25174055f428254427e7541139037eb9a34fc109.1477667878.git.mjt@msgid.tls.msk.ru
State Accepted
Commit 25174055f428254427e7541139037eb9a34fc109
Headers show

Commit Message

Michael Tokarev Oct. 28, 2016, 3:18 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>


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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.1.4
diff mbox

Patch

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