[libvirt] [PATCH] storage: Fix coverity warning

Cole Robinson crobinso at redhat.com
Thu Jun 23 22:41:18 UTC 2016


After commit e808d3f227 cbdata is always available here, so the
check is pointless
---
 src/storage/storage_driver.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 4b5419d..d75c5aa 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2442,12 +2442,10 @@ storageVolUpload(virStorageVolPtr obj,
     /* Add cleanup callback - call after uploadVol since the stream
      * is then fully set up
      */
-    if (cbdata) {
-        virFDStreamSetInternalCloseCb(stream,
-                                      virStorageVolFDStreamCloseCb,
-                                      cbdata, NULL);
-        cbdata = NULL;
-    }
+    virFDStreamSetInternalCloseCb(stream,
+                                  virStorageVolFDStreamCloseCb,
+                                  cbdata, NULL);
+    cbdata = NULL;
 
  cleanup:
     virStoragePoolObjUnlock(pool);
-- 
2.7.4




More information about the libvir-list mailing list