[libvirt] [PATCH 3/3] sheepdog: Add Coverity filter

John Ferlan jferlan at redhat.com
Tue Mar 5 12:43:13 UTC 2013


Add a Coverity dead_error_condition tag since it's not possible for next
to be NULL at that point and thus exit the while loop.  If next were NULL
the condition to set it would have done the return -1.
---
 src/storage/storage_backend_sheepdog.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
index 218284d..7b564bd 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -85,6 +85,8 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
         pool->available = pool->capacity - pool->allocation;
         return 0;
 
+         /* coverity[dead_error_condition] - since we return -1 above we'll
+          *                                  never get to return -1 below */
     } while ((p = next));
 
     return -1;
-- 
1.8.1.2




More information about the libvir-list mailing list