]> sourceware.org Git - lvm2.git/commitdiff
Check for vg_name existance
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 27 Feb 2012 11:23:15 +0000 (11:23 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 27 Feb 2012 11:23:15 +0000 (11:23 +0000)
Since vg_read() mda ops could be called with NULL vg_name,
check it before derefence also for pool and format1.

WHATS_NEW
lib/format1/format1.c
lib/format_pool/format_pool.c

index d0bd6c939e7146dfd3d1fc7207db74dad34d91c5..131691799d1434782134ede2ccf1c4405ede4f61 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Check for existance of vg_name in _format1/_pool_vg_read().
   Fix missing break in _format_pvsegs (2.02.92).
   Test seg pointer for non-null it in raid_target_percent error path.
   Check for errors in _init_tags() during config loading.
index 1fac67969e3e8a4cceb0c52e46b6986870aeffff..f57e36398730af7f2f3241cd7b1e15a3c0d83aae 100644 (file)
@@ -186,7 +186,8 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid,
        DM_LIST_INIT(pvs);
 
        /* Strip dev_dir if present */
-       vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
+       if (vg_name)
+               vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
 
        if (!(vg = alloc_vg("format1_vg_read", fid->fmt->cmd, NULL)))
                return_NULL;
index 8731e95630f2aeefd4d91ef06c3d19aaa157e61a..08b59aa2ed57208ceb6f0ca63fe86127ac79389c 100644 (file)
@@ -110,7 +110,8 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid,
        /* We can safely ignore the mda passed in */
 
        /* Strip dev_dir if present */
-       vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
+       if (vg_name)
+               vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
 
        /* Set vg_name through read_pool_pds() */
        if (!(vg = alloc_vg("pool_vg_read", fid->fmt->cmd, NULL)))
This page took 1.796966 seconds and 5 git commands to generate.