qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration: Remove unneeded NULL check from migrate_fd_error()
@ 2016-10-21 17:41 Peter Maydell
  2016-10-26 18:41 ` Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2016-10-21 17:41 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: patches, 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 <peter.maydell@linaro.org>
---
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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] migration: Remove unneeded NULL check from migrate_fd_error()
  2016-10-21 17:41 [Qemu-devel] [PATCH] migration: Remove unneeded NULL check from migrate_fd_error() Peter Maydell
@ 2016-10-26 18:41 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2016-10-26 18:41 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel, qemu-trivial; +Cc: Amit Shah, Juan Quintela, patches

Applied to -trivial, thanks!

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-26 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-21 17:41 [Qemu-devel] [PATCH] migration: Remove unneeded NULL check from migrate_fd_error() Peter Maydell
2016-10-26 18:41 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).