]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Resolve Coverity IDENTICAL_BRANCHES
authorJohn Ferlan <jferlan@redhat.com>
Fri, 1 May 2015 11:55:29 +0000 (07:55 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 May 2015 00:02:36 +0000 (20:02 -0400)
Coverity complains that in the error paths both the < 0 condition and
the success path after the qemuDomainObjExitMonitor failure will end
up going to cleanup.  So just use ignore_value in this error path to
resolve the complaint.

src/qemu/qemu_hotplug.c

index 613b728bf29b9e41f68c649a69732118c4561dca..4e9603e88bbef48948b47141fa7b298525f67077 100644 (file)
@@ -3640,15 +3640,13 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
     qemuDomainObjEnterMonitor(driver, vm);
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuMonitorDelDevice(priv->mon, detach->info.alias)) {
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
-                goto cleanup;
+            ignore_value(qemuDomainObjExitMonitor(driver, vm));
             goto cleanup;
         }
     } else {
         if (qemuMonitorRemovePCIDevice(priv->mon,
                                        &detach->info.addr.pci) < 0) {
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
-                goto cleanup;
+            ignore_value(qemuDomainObjExitMonitor(driver, vm));
             goto cleanup;
         }
     }
@@ -4136,8 +4134,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
 
     qemuDomainObjEnterMonitor(driver, vm);
     if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
-        if (qemuDomainObjExitMonitor(driver, vm) < 0)
-            goto cleanup;
+        ignore_value(qemuDomainObjExitMonitor(driver, vm));
         goto cleanup;
     }
     if (qemuDomainObjExitMonitor(driver, vm) < 0)