[libvirt] [PATCH] virpcitest: fix coverity issues

Pavel Hrdina phrdina at redhat.com
Thu Feb 6 15:18:28 UTC 2014


The coverity server complains about the dev->stubDriver that it was
freed by the virPCIDeviceSetStubDriver function, but it somehow don't
get the fact that into the variable is immediately assigned new string.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 tests/virpcitest.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 994b300..8ff3b1d 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -248,6 +248,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
     if (!dev)
         goto cleanup;
 
+    /* coverity[freed_arg] */
     if (virPCIDeviceSetStubDriver(dev, "pci-stub") < 0 ||
         virPCIDeviceDetach(dev, NULL, NULL) < 0)
         goto cleanup;
@@ -269,6 +270,7 @@ testVirPCIDeviceDetachFail(const void *opaque)
     if (!dev)
         goto cleanup;
 
+    /* coverity[freed_arg] */
     if (virPCIDeviceSetStubDriver(dev, "vfio-pci") < 0)
         goto cleanup;
 
-- 
1.8.3.1




More information about the libvir-list mailing list