Skip to content

Commit

Permalink
md: unlock mddev_lock on an error path.
Browse files Browse the repository at this point in the history
This error path retuns while still holding the lock - bad.

Fixes: 6791875 ("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>
  • Loading branch information
NeilBrown committed Jun 25, 2015
1 parent bd69192 commit 9a8c0fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9a8c0fa

Please sign in to comment.