From 80e524de863bc21bd00264ec6467dfff116577dd Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 5 Mar 2013 07:28:04 -0500 Subject: [PATCH] sheepdog: Adjust logic to break while loop to avoid Coverity error Change the various "return -1" to "break". Avoids Coverity error and perhaps other/future analyzer issues. --- src/storage/storage_backend_sheepdog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index 218284d317..35a3a04940 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -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; -- GitLab