From cd4c26a27fd425755f9f4c7d2318942a184f7390 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 8 Feb 2012 10:56:17 +0000 Subject: [PATCH] Set status for error path Do not leave status unitialized, since in some cases, it's tested, when the function returns error. --- WHATS_NEW | 1 + tools/lvresize.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 90c4ef32a..e3eae3a6c 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.91 - =================================== + Set status in _fsadm_cmd() for error path. Add missing deps for lvm2api for rebuild when lvm-internal is changed. Fix resource leaks for failing allocation of formats (lvm1/2,pool). Release allocated resources in error path for composite_filter_create(). diff --git a/tools/lvresize.c b/tools/lvresize.c index 14637bf46..bf2388e18 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -159,6 +159,9 @@ static int _fsadm_cmd(struct cmd_context *cmd, argv[i++] = (fcmd == FSADM_CMD_RESIZE) ? "resize" : "check"; + if (status) + *status = -1; + if (dm_snprintf(lv_path, PATH_MAX, "%s%s/%s", cmd->dev_dir, lp->vg_name, lp->lv_name) < 0) { log_error("Couldn't create LV path for %s", lp->lv_name);