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>
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index f57a150..f07d40e4 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -529,7 +529,7 @@
logfs_cleanup_rw(sb);
if (super->s_erase_page)
__free_page(super->s_erase_page);
- super->s_devops->put_device(sb);
+ super->s_devops->put_device(super);
logfs_mempool_destroy(super->s_btree_pool);
logfs_mempool_destroy(super->s_alias_pool);
kfree(super);
@@ -586,8 +586,8 @@
deactivate_locked_super(sb);
return err;
err0:
+ super->s_devops->put_device(super);
kfree(super);
- //devops->put_device(sb);
return err;
}