]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix for NULL pointer dereference.
authorArtur Wojcik <artur.wojcik@intel.com>
Thu, 10 Dec 2009 19:03:39 +0000 (12:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 10 Dec 2009 19:03:39 +0000 (12:03 -0700)
Suspicious dereference of pointer 'super' before NULL check at
line 3429.

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c

index 4b8e2b7763c6ed5d32e970ce998400aa59ea34ea..03dcbd5b83fdb280c726fbd07102b125452c55a3 100644 (file)
@@ -3426,7 +3426,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
 {
        struct stat stb;
        struct intel_super *super = st->sb;
-       struct imsm_super *mpb = super->anchor;
+       struct imsm_super *mpb;
        struct dl *dl;
        unsigned long long pos = 0;
        unsigned long long maxsize;
@@ -3436,6 +3436,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
        /* We must have the container info already read in. */
        if (!super)
                return 0;
+       mpb = super->anchor;
 
        if (!is_raid_level_supported(super->orom, level, raiddisks)) {
                pr_vrb(": platform does not support raid%d with %d disk%s\n",