summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-06-25 07:06:40 (GMT)
committerNeilBrown <neilb@suse.de>2015-06-25 07:14:09 (GMT)
commit9a8c0fa861e4db60409b4dda254cef5e17e4d43c (patch)
tree9b812ff7b225fa4eb1376f57c253225fb9a1327e /drivers/md
parentbd6919228d7e1867ae9e24ab27e3e4a366c87d21 (diff)
downloadlinux-9a8c0fa861e4db60409b4dda254cef5e17e4d43c.tar.xz
md: unlock mddev_lock on an error path.
This error path retuns while still holding the lock - bad. Fixes: 6791875e2e53 ("md: make reconfig_mutex optional for writes to md sysfs files.") Cc: stable@vger.kernel.org (v4.0+) Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 939739f..5fcce73 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4014,8 +4014,10 @@ new_dev_store(struct mddev *mddev, const char *buf, size_t len)
else
rdev = md_import_device(dev, -1, -1);
- if (IS_ERR(rdev))
+ if (IS_ERR(rdev)) {
+ mddev_unlock(mddev);
return PTR_ERR(rdev);
+ }
err = bind_rdev_to_array(rdev, mddev);
out:
if (err)