summaryrefslogtreecommitdiff
path: root/fs/logfs/dev_bdev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-26 12:06:00 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-29 12:16:48 +0400
commite5a0726a953daf224ae42bcf5edaa64f71b4e8a7 (patch)
tree0f0be6f8e0b2324b5e29ac959837ab470afa0053 /fs/logfs/dev_bdev.c
parent7d945a3aa7608f68dba04083d3421e0b43052660 (diff)
downloadlinux-e5a0726a953daf224ae42bcf5edaa64f71b4e8a7.tar.xz
logfs: fix a leak in get_sb
a) switch ->put_device() to logfs_super * b) actually call it on early failures in logfs_get_sb_device() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/logfs/dev_bdev.c')
-rw-r--r--fs/logfs/dev_bdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c
index 223b673dcc7b..92ca6fbe09bd 100644
--- a/fs/logfs/dev_bdev.c
+++ b/fs/logfs/dev_bdev.c
@@ -298,9 +298,9 @@ static int bdev_write_sb(struct super_block *sb, struct page *page)
return sync_request(page, bdev, WRITE);
}
-static void bdev_put_device(struct super_block *sb)
+static void bdev_put_device(struct logfs_super *s)
{
- close_bdev_exclusive(logfs_super(sb)->s_bdev, FMODE_READ|FMODE_WRITE);
+ close_bdev_exclusive(s->s_bdev, FMODE_READ|FMODE_WRITE);
}
static int bdev_can_write_buf(struct super_block *sb, u64 ofs)