diff options
Diffstat (limited to 'fs/9p/vfs_super.c')
-rw-r--r-- | fs/9p/vfs_super.c | 13 |
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 | |||
127 | 127 | ||
128 | if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { | 128 | if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) { |
129 | dprintk(DEBUG_ERROR, "problem initiating session\n"); | 129 | dprintk(DEBUG_ERROR, "problem initiating session\n"); |
130 | kfree(v9ses); | 130 | sb = ERR_PTR(newfid); |
131 | return ERR_PTR(newfid); | 131 | goto out_free_session; |
132 | } | 132 | } |
133 | 133 | ||
134 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); | 134 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); |
135 | 135 | if (IS_ERR(sb)) | |
136 | goto out_close_session; | ||
136 | v9fs_fill_super(sb, v9ses, flags); | 137 | v9fs_fill_super(sb, v9ses, flags); |
137 | 138 | ||
138 | inode = v9fs_get_inode(sb, S_IFDIR | mode); | 139 | inode = v9fs_get_inode(sb, S_IFDIR | mode); |
@@ -185,6 +186,12 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
185 | 186 | ||
186 | return sb; | 187 | return sb; |
187 | 188 | ||
189 | out_close_session: | ||
190 | v9fs_session_close(v9ses); | ||
191 | out_free_session: | ||
192 | kfree(v9ses); | ||
193 | return sb; | ||
194 | |||
188 | put_back_sb: | 195 | put_back_sb: |
189 | /* deactivate_super calls v9fs_kill_super which will frees the rest */ | 196 | /* deactivate_super calls v9fs_kill_super which will frees the rest */ |
190 | up_write(&sb->s_umount); | 197 | up_write(&sb->s_umount); |