diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 51c19f86ff99..2580ac1b9b0f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -276,6 +276,7 @@ static mddev_t * mddev_find(dev_t unit) | |||
276 | atomic_set(&new->active, 1); | 276 | atomic_set(&new->active, 1); |
277 | spin_lock_init(&new->write_lock); | 277 | spin_lock_init(&new->write_lock); |
278 | init_waitqueue_head(&new->sb_wait); | 278 | init_waitqueue_head(&new->sb_wait); |
279 | init_waitqueue_head(&new->recovery_wait); | ||
279 | new->reshape_position = MaxSector; | 280 | new->reshape_position = MaxSector; |
280 | new->resync_max = MaxSector; | 281 | new->resync_max = MaxSector; |
281 | new->level = LEVEL_NONE; | 282 | new->level = LEVEL_NONE; |
@@ -3896,8 +3897,10 @@ static void autorun_devices(int part) | |||
3896 | 3897 | ||
3897 | md_probe(dev, NULL, NULL); | 3898 | md_probe(dev, NULL, NULL); |
3898 | mddev = mddev_find(dev); | 3899 | mddev = mddev_find(dev); |
3899 | if (!mddev) { | 3900 | if (!mddev || !mddev->gendisk) { |
3900 | printk(KERN_ERR | 3901 | if (mddev) |
3902 | mddev_put(mddev); | ||
3903 | printk(KERN_ERR | ||
3901 | "md: cannot allocate memory for md drive.\n"); | 3904 | "md: cannot allocate memory for md drive.\n"); |
3902 | break; | 3905 | break; |
3903 | } | 3906 | } |
@@ -5665,7 +5668,6 @@ void md_do_sync(mddev_t *mddev) | |||
5665 | window/2,(unsigned long long) max_sectors/2); | 5668 | window/2,(unsigned long long) max_sectors/2); |
5666 | 5669 | ||
5667 | atomic_set(&mddev->recovery_active, 0); | 5670 | atomic_set(&mddev->recovery_active, 0); |
5668 | init_waitqueue_head(&mddev->recovery_wait); | ||
5669 | last_check = 0; | 5671 | last_check = 0; |
5670 | 5672 | ||
5671 | if (j>2) { | 5673 | if (j>2) { |