]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
sheepdog: Adjust logic to break while loop to avoid Coverity error
authorJohn Ferlan <jferlan@redhat.com>
Tue, 5 Mar 2013 12:28:04 +0000 (07:28 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 Mar 2013 03:52:51 +0000 (22:52 -0500)
Change the various "return -1" to "break".  Avoids Coverity error and
perhaps other/future analyzer issues.

src/storage/storage_backend_sheepdog.c

index 218284d3171c9048d75ce02f55e10cb5ff0fc12a..35a3a049404a12c209a0fef3e356c148bb74890b 100644 (file)
@@ -66,7 +66,7 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
         if ((next = strchr(p, '\n')))
             ++next;
         else
-            return -1;
+            break;
 
         if (!STRPREFIX(p, "Total "))
             continue;
@@ -74,13 +74,13 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
         p = p + 6;
 
         if (virStrToLong_ull(p, &end, 10, &pool->capacity) < 0)
-            return -1;
+            break;
 
         if ((p = end + 1) > next)
-            return -1;
+            break;
 
         if (virStrToLong_ull(p, &end, 10, &pool->allocation) < 0)
-            return -1;
+            break;
 
         pool->available = pool->capacity - pool->allocation;
         return 0;