]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Resolve Coverity issue regarding not checking return value
authorJohn Ferlan <jferlan@redhat.com>
Tue, 5 Nov 2013 12:55:54 +0000 (07:55 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 5 Nov 2013 12:55:54 +0000 (07:55 -0500)
Coverity complains that the call to virPCIDeviceDetach() in
qemuPrepareHostdevPCIDevices() doesn't check status return like
other calls.  Seems this just was lurking until a recent change
to this module resulted in Coverity looking harder and finding
the issue.  Introduced by 'a4efb2e33' when function was called
'pciReAttachDevice()'

Just added a ignore_value() since it doesn't appear to matter
if the call fails since we're on a failure path already.

src/qemu/qemu_hostdev.c

index 57ab28c026b52a5b99793cc6df2b00364e26c1cf..f5cad15cf917e6625f1297039831ea23e90dda27 100644 (file)
@@ -819,7 +819,8 @@ reattachdevs:
         /* NB: This doesn't actually re-bind to original driver, just
          * unbinds from the stub driver
          */
-        virPCIDeviceReattach(dev, driver->activePciHostdevs, NULL);
+        ignore_value(virPCIDeviceReattach(dev, driver->activePciHostdevs,
+                                          NULL));
     }
 
 cleanup: