diff options
author | Ian Kent <raven@themaw.net> | 2019-10-02 17:56:33 +0800 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-10-09 22:53:57 -0400 |
commit | 6fcf0c72e4b9360768cf5ef543c4f14c34800ee8 (patch) | |
tree | a298cb78d99e35e2847e2fec757aeb6503a90b4a | |
parent | 33f37c648812bdbe1bd1eea75ddab3e799d51e77 (diff) |
vfs: add missing blkdev_put() in get_tree_bdev()
Is there are a couple of missing blkdev_put() in get_tree_bdev()?
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/super.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c index beaf076d9733..530dd13fa98b 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1296,6 +1296,7 @@ int get_tree_bdev(struct fs_context *fc, mutex_lock(&bdev->bd_fsfreeze_mutex); if (bdev->bd_fsfreeze_count > 0) { mutex_unlock(&bdev->bd_fsfreeze_mutex); + blkdev_put(bdev, mode); warnf(fc, "%pg: Can't mount, blockdev is frozen", bdev); return -EBUSY; } @@ -1304,8 +1305,10 @@ int get_tree_bdev(struct fs_context *fc, fc->sget_key = bdev; s = sget_fc(fc, test_bdev_super_fc, set_bdev_super_fc); mutex_unlock(&bdev->bd_fsfreeze_mutex); - if (IS_ERR(s)) + if (IS_ERR(s)) { + blkdev_put(bdev, mode); return PTR_ERR(s); + } if (s->s_root) { /* Don't summarily change the RO/RW state. */ |