summaryrefslogtreecommitdiff
path: root/fs/9p/vfs_super.c
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@hera.kernel.org>2006-04-11 09:54:06 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 17:18:41 +0400
commit00fbc6dfe7c4487f812829bff79c3121c8fd3bca (patch)
tree1813bfe351db1424839be30c99dc620e0ca52457 /fs/9p/vfs_super.c
parente1a2509023785bd3199ac068ab80155aeba01265 (diff)
downloadlinux-00fbc6dfe7c4487f812829bff79c3121c8fd3bca.tar.xz
[PATCH] 9p: handle sget() failure
Handle a failing sget() in v9fs_get_sb(). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p/vfs_super.c')
-rw-r--r--fs/9p/vfs_super.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index b0a0ae509c00..61c599b4a1e3 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -127,12 +127,13 @@ static struct super_block *v9fs_get_sb(struct file_system_type
if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
dprintk(DEBUG_ERROR, "problem initiating session\n");
- kfree(v9ses);
- return ERR_PTR(newfid);
+ sb = ERR_PTR(newfid);
+ goto out_free_session;
}
sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
-
+ if (IS_ERR(sb))
+ goto out_close_session;
v9fs_fill_super(sb, v9ses, flags);
inode = v9fs_get_inode(sb, S_IFDIR | mode);
@@ -185,6 +186,12 @@ static struct super_block *v9fs_get_sb(struct file_system_type
return sb;
+out_close_session:
+ v9fs_session_close(v9ses);
+out_free_session:
+ kfree(v9ses);
+ return sb;
+
put_back_sb:
/* deactivate_super calls v9fs_kill_super which will frees the rest */
up_write(&sb->s_umount);