]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Sep 2014 20:40:34 +0000 (16:40 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 11 Sep 2014 12:10:13 +0000 (08:10 -0400)
If the qemuMigrationEatCookie() fails to set mig, we jump to cleanup:
which will call qemuMigrationCancelDriveMirror() without first checking
if mig == NULL

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_migration.c

index e4b664b19cd6857fc2a922f5e8c26e4b0e5d613d..4819c047548d6ef2545653ca13ec03ba63b371ad 100644 (file)
@@ -3614,7 +3614,8 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         orig_err = virSaveLastError();
 
     /* cancel any outstanding NBD jobs */
-    qemuMigrationCancelDriveMirror(mig, driver, vm);
+    if (mig)
+        qemuMigrationCancelDriveMirror(mig, driver, vm);
 
     if (spec->fwdType != MIGRATION_FWD_DIRECT) {
         if (iothread && qemuMigrationStopTunnel(iothread, ret < 0) < 0)