From 685be1dc7a58b74b2168cf682be0f1580edd2ceb Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 11 Dec 2009 13:11:56 +0000 Subject: Fix unlocking vg in some pvresize and toollib error paths. --- tools/pvresize.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/pvresize.c') diff --git a/tools/pvresize.c b/tools/pvresize.c index 7a911ac8..292e3cc1 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -60,8 +60,12 @@ static int _pv_resize_single(struct cmd_context *cmd, vg = vg_read_for_update(cmd, vg_name, NULL, 0); - if (vg_read_error(vg)) - goto bad; + if (vg_read_error(vg)) { + vg_release(vg); + log_error("Unable to read volume group \"%s\".", + vg_name); + return 0; + } if (!(pvl = find_pv_in_vg(vg, pv_name))) { log_error("Unable to find \"%s\" in volume group \"%s\"", -- cgit