dev-mornfall-lvmcache - lvmetad: fix error paths
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f787b575b52fcbfa8327d083eae4f2baf296b1cf Commit: f787b575b52fcbfa8327d083eae4f2baf296b1cf Parent: 377e06b0f8ea10c222a0d38472dbbb05fde1f2d3 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Apr 19 21:19:54 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sun Apr 21 23:04:53 2013 +0200
lvmetad: fix error paths
Also add missing goto out on error.
Error path missed return NULL leading to double free of enc_value.
--- WHATS_NEW | 1 + lib/cache/lvmetad.c | 4 +++- lib/config/config.c | 1 + 3 files changed, 5 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Fix lvmetad error path in lvmetad_vg_lookup() for null vgname. Fix clvmd _cluster_request() return code in memory fail path. Add writemostly/writebehind support for RAID1 Add lv_change_activate() for common activation code in vg/lvchange.
lib/cache/lvmetad.c +3 -1
@@ -343,8 +343,10 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna reply =_lvmetad_send ("vg_lookup" ,"uuid = %s" , uuid,NULL ); diag_name = uuid; }else { -if (!vgname) +if (!vgname) {log_error (INTERNAL_ERROR "VG name required (VGID not available)" ); + goto out; + }log_debug_lvmetad ("Asking lvmetad for VG %s" , vgname); reply =_lvmetad_send ("vg_lookup" ,"name = %s" , vgname,NULL ); diag_name = vgname;
lib/config/config.c +1 -0
@@ -967,6 +967,7 @@ static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,if (!(v =dm_config_create_value (cft))) {log_error ("Failed to create default config array value for %s." , def->name);dm_free (enc_value); +return NULL ; }if (oldv) oldv->next = v;