aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1a9131b6594c..24925f2aa235 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7092,7 +7092,8 @@ static int md_open(struct block_device *bdev, fmode_t mode)
7092 7092
7093 if (test_bit(MD_CLOSING, &mddev->flags)) { 7093 if (test_bit(MD_CLOSING, &mddev->flags)) {
7094 mutex_unlock(&mddev->open_mutex); 7094 mutex_unlock(&mddev->open_mutex);
7095 return -ENODEV; 7095 err = -ENODEV;
7096 goto out;
7096 } 7097 }
7097 7098
7098 err = 0; 7099 err = 0;
@@ -7101,6 +7102,8 @@ static int md_open(struct block_device *bdev, fmode_t mode)
7101 7102
7102 check_disk_change(bdev); 7103 check_disk_change(bdev);
7103 out: 7104 out:
7105 if (err)
7106 mddev_put(mddev);
7104 return err; 7107 return err;
7105} 7108}
7106 7109