Commit 00fbc6df authored by Eric Van Hensbergen's avatar Eric Van Hensbergen Committed by Linus Torvalds

[PATCH] 9p: handle sget() failure

Handle a failing sget() in v9fs_get_sb().
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e1a25090
...@@ -127,12 +127,13 @@ static struct super_block *v9fs_get_sb(struct file_system_type ...@@ -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) { if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
dprintk(DEBUG_ERROR, "problem initiating session\n"); dprintk(DEBUG_ERROR, "problem initiating session\n");
kfree(v9ses); sb = ERR_PTR(newfid);
return ERR_PTR(newfid); goto out_free_session;
} }
sb = sget(fs_type, NULL, v9fs_set_super, v9ses); sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
if (IS_ERR(sb))
goto out_close_session;
v9fs_fill_super(sb, v9ses, flags); v9fs_fill_super(sb, v9ses, flags);
inode = v9fs_get_inode(sb, S_IFDIR | mode); inode = v9fs_get_inode(sb, S_IFDIR | mode);
...@@ -185,6 +186,12 @@ static struct super_block *v9fs_get_sb(struct file_system_type ...@@ -185,6 +186,12 @@ static struct super_block *v9fs_get_sb(struct file_system_type
return sb; return sb;
out_close_session:
v9fs_session_close(v9ses);
out_free_session:
kfree(v9ses);
return sb;
put_back_sb: put_back_sb:
/* deactivate_super calls v9fs_kill_super which will frees the rest */ /* deactivate_super calls v9fs_kill_super which will frees the rest */
up_write(&sb->s_umount); up_write(&sb->s_umount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment