summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-05-03 12:01:20 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2019-05-03 13:17:22 +0200
commit3c70ae1803b06dea68b2e6e1ec2176b3f3fe9707 (patch)
tree824c45c7bfd2beb900947b02af0eeb7cdc3873b2
parent99de816a1bb6414e4611030c8d83766b1ff3cd65 (diff)
downloadlvm2-3c70ae1803b06dea68b2e6e1ec2176b3f3fe9707.tar.gz
clean: avoid cleaning iterator on error path
Return error dirrectly instead of using 'out' code path.
-rw-r--r--tools/toollib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/toollib.c b/tools/toollib.c
index b35283916..8e882e926 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3933,14 +3933,14 @@ static int _get_all_devices(struct cmd_context *cmd,
if (!(dil = dm_pool_alloc(cmd->mem, sizeof(*dil)))) {
log_error("device_id_list alloc failed.");
- goto out;
+ return ECMD_FAILED;
}
strncpy(dil->pvid, hint->pvid, ID_LEN);
dil->dev = dev;
dm_list_add(all_devices, &dil->list);
}
- return 1;
+ return ECMD_PROCESSED;
}
log_debug("Getting list of all devices from system");