1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-09 17:44:26 +03:00

coverity: add some tests for function results

Even though they cannot normally happen...
This commit is contained in:
Zdenek Kabelac
2016-07-12 16:43:12 +02:00
parent 4661c6b6fb
commit 4e1bf7acd3
2 changed files with 5 additions and 3 deletions

View File

@@ -861,7 +861,7 @@ static int remove_metadata(lvmetad_state *s, const char *vgid, int update_pvids)
/* update_pvid_to_vgid will clear/free the pvid_to_vgid hash */
if (update_pvids && meta_lookup)
_update_pvid_to_vgid(s, meta_lookup, "#orphan", 0);
(void) _update_pvid_to_vgid(s, meta_lookup, "#orphan", 0);
/* free the unmapped data */

View File

@@ -4641,7 +4641,8 @@ static int _check_devs_used_correspond_with_lv(struct dm_pool *mem, struct dm_li
dev = dl->dev;
if (!(dev->flags & DEV_ASSUMED_FOR_LV)) {
if (!found_inconsistent) {
dm_pool_begin_object(mem, 32);
if (!dm_pool_begin_object(mem, 32))
return_0;
found_inconsistent = 1;
} else {
if (!dm_pool_grow_object(mem, DEV_LIST_DELIM, sizeof(DEV_LIST_DELIM) - 1))
@@ -4674,7 +4675,8 @@ static int _check_devs_used_correspond_with_lv(struct dm_pool *mem, struct dm_li
}
if (!(dev->flags & DEV_USED_FOR_LV)) {
if (!found_inconsistent) {
dm_pool_begin_object(mem, 32);
if (!dm_pool_begin_object(mem, 32))
return_0;
found_inconsistent = 1;
} else {
if (!dm_pool_grow_object(mem, DEV_LIST_DELIM, sizeof(DEV_LIST_DELIM) - 1))