Skip to content

Commit

Permalink
9p: fix memory leak in v9fs_get_sb
Browse files Browse the repository at this point in the history
This patch fixes a memory leak in v9fs_get_sb.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Latchesar Ionkov authored and Eric Van Hensbergen committed Nov 6, 2007
1 parent 2655e2c commit dda6b02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,

P9_DPRINTK(P9_DEBUG_VFS, " \n");

st = NULL;
v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
if (!v9ses)
return -ENOMEM;
Expand Down Expand Up @@ -164,10 +165,12 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
root->d_inode->i_ino = v9fs_qid2ino(&st->qid);
v9fs_stat2inode(st, root->d_inode, sb);
v9fs_fid_add(root, fid);
kfree(st);

return simple_set_mnt(mnt, sb);

error:
kfree(st);
if (fid)
p9_client_clunk(fid);

Expand Down

0 comments on commit dda6b02

Please sign in to comment.