diff options
Diffstat (limited to 'drivers/md/raid6main.c')
-rw-r--r-- | drivers/md/raid6main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index cd477ebf2ee4..c7632f6cc487 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -2006,11 +2006,14 @@ static int run(mddev_t *mddev) | |||
2006 | return -EIO; | 2006 | return -EIO; |
2007 | } | 2007 | } |
2008 | 2008 | ||
2009 | mddev->private = kzalloc(sizeof (raid6_conf_t) | 2009 | mddev->private = kzalloc(sizeof (raid6_conf_t), GFP_KERNEL); |
2010 | + mddev->raid_disks * sizeof(struct disk_info), | ||
2011 | GFP_KERNEL); | ||
2012 | if ((conf = mddev->private) == NULL) | 2010 | if ((conf = mddev->private) == NULL) |
2013 | goto abort; | 2011 | goto abort; |
2012 | conf->disks = kzalloc(mddev->raid_disks * sizeof(struct disk_info), | ||
2013 | GFP_KERNEL); | ||
2014 | if (!conf->disks) | ||
2015 | goto abort; | ||
2016 | |||
2014 | conf->mddev = mddev; | 2017 | conf->mddev = mddev; |
2015 | 2018 | ||
2016 | if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL) | 2019 | if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL) |
@@ -2158,6 +2161,7 @@ abort: | |||
2158 | print_raid6_conf(conf); | 2161 | print_raid6_conf(conf); |
2159 | safe_put_page(conf->spare_page); | 2162 | safe_put_page(conf->spare_page); |
2160 | kfree(conf->stripe_hashtbl); | 2163 | kfree(conf->stripe_hashtbl); |
2164 | kfree(conf->disks); | ||
2161 | kfree(conf); | 2165 | kfree(conf); |
2162 | } | 2166 | } |
2163 | mddev->private = NULL; | 2167 | mddev->private = NULL; |