You need to sign in or sign up before continuing.
提交 80e524de 编写于 作者: J John Ferlan

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.
上级 40e90449
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册