Ensure we always have origin defined
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:05:46 +0000 (12:05 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 25 Oct 2010 12:05:46 +0000 (12:05 +0000)
Reported by clang as: Logic error Dereference of null pointer
Make sure the code path could not use NULL origin because of some internal
code error.

tools/lvcreate.c

index de5b59cfb6d0bb7139e1918660da9f9e2c272875..a9e3c2d8f8d61d5eaa24712ea1f91346d723320f 100644 (file)
@@ -179,6 +179,10 @@ static int _update_extents_params(struct volume_group *vg,
                                          lp->origin);
                                return 0;
                        }
+                       if (!origin) {
+                               log_error(INTERNAL_ERROR "Couldn't find origin volume.");
+                               return 0;
+                       }
                        lp->extents = lp->extents * origin->le_count / 100;
                        break;
                case PERCENT_NONE:
This page took 0.04384 seconds and 5 git commands to generate.