]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Seg Fault in incremental if BBM log detected
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>
Fri, 18 Feb 2011 12:51:17 +0000 (23:51 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 18 Feb 2011 12:51:17 +0000 (23:51 +1100)
Bug  detected for imsm metadata.
Assembling of array using Incremental switch generate segmentation
fault if BBM log is detected.
Reason: missing return from Incremental_container if BBM is detected
and unnecessary list=NULL assignment.
This patch fix the problem and memory leak in this area.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index 889184fe8e8ebd5bc29efd9bd96ff634bfca97e0..4c4b0c7ec21ce66d2d29e159de991352de6136c7 100644 (file)
@@ -1471,7 +1471,9 @@ static int Incremental_container(struct supertype *st, char *devname,
        if (list->array.state & (1<<MD_SB_BBM_ERRORS)) {
                fprintf(stderr, Name ": BBM log found in metadata. "
                                        "Cannot activate array(s).\n");
-               list = NULL;
+               /* free container data and exit */
+               sysfs_free(list);
+               return 2;
        }
 
        for (ra = list ; ra ; ra = ra->next) {