diff options
author | Krzysztof Wojcik <krzysztof.wojcik@intel.com> | 2011-02-18 23:51:17 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-18 23:51:17 +1100 |
commit | 51cf74194f70ff52ed460395c2bb6b61c2473e06 (patch) | |
tree | 2423b8060f2c90ff06e7bc87eaa9bbb8e3632656 /Incremental.c | |
parent | c26d78fe040673b019e1c2e4a5507969d2869765 (diff) |
FIX: Seg Fault in incremental if BBM log detected
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>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c index 889184fe..4c4b0c7e 100644 --- a/Incremental.c +++ b/Incremental.c @@ -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) { |