9119d9
From 6bf8ed4ba21ebc1bb9f2a1619925cf6b1a95db36 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <6bf8ed4ba21ebc1bb9f2a1619925cf6b1a95db36@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Mon, 15 Sep 2014 15:13:51 -0400
9119d9
Subject: [PATCH] qemu: Resolve Coverity FORWARD_NULL
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1141209
9119d9
9119d9
If the qemuMigrationEatCookie() fails to set mig, we jump to cleanup:
9119d9
which will call qemuMigrationCancelDriveMirror() without first checking
9119d9
if mig == NULL
9119d9
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
(cherry picked from commit e5baef83e131c75bda00bed59b7b2494675b4451)
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_migration.c | 3 ++-
9119d9
 1 file changed, 2 insertions(+), 1 deletion(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
9119d9
index 3934566..858794d 100644
9119d9
--- a/src/qemu/qemu_migration.c
9119d9
+++ b/src/qemu/qemu_migration.c
9119d9
@@ -3614,7 +3614,8 @@ qemuMigrationRun(virQEMUDriverPtr driver,
9119d9
         orig_err = virSaveLastError();
9119d9
 
9119d9
     /* cancel any outstanding NBD jobs */
9119d9
-    qemuMigrationCancelDriveMirror(mig, driver, vm);
9119d9
+    if (mig)
9119d9
+        qemuMigrationCancelDriveMirror(mig, driver, vm);
9119d9
 
9119d9
     if (spec->fwdType != MIGRATION_FWD_DIRECT) {
9119d9
         if (iothread && qemuMigrationStopTunnel(iothread, ret < 0) < 0)
9119d9
-- 
9119d9
2.1.0
9119d9