From e5a0726a953daf224ae42bcf5edaa64f71b4e8a7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 26 Jul 2010 12:06:00 +0400 Subject: 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 --- fs/logfs/dev_mtd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/logfs/dev_mtd.c') diff --git a/fs/logfs/dev_mtd.c b/fs/logfs/dev_mtd.c index 9e3dbe3712a..7466e9dcc8c 100644 --- a/fs/logfs/dev_mtd.c +++ b/fs/logfs/dev_mtd.c @@ -230,9 +230,9 @@ static void mtd_writeseg(struct super_block *sb, u64 ofs, size_t len) __mtd_writeseg(sb, ofs, ofs >> PAGE_SHIFT, len >> PAGE_SHIFT); } -static void mtd_put_device(struct super_block *sb) +static void mtd_put_device(struct logfs_super *s) { - put_mtd_device(logfs_super(sb)->s_mtd); + put_mtd_device(s->s_mtd); } static int mtd_can_write_buf(struct super_block *sb, u64 ofs) -- cgit v1.2.3