diff options
author | Abhishek Kulkarni <adkulkar@umail.iu.edu> | 2009-07-19 21:41:54 +0200 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@strongmad.austin.ibm.com> | 2009-08-17 23:27:57 +0200 |
commit | 02bc35672b2fdf251e264adca5407792f63191e4 (patch) | |
tree | 301e2d999daed7afd11596bc89087750a4509e1c /fs/9p | |
parent | 9p: minor comment fixes (diff) | |
download | linux-02bc35672b2fdf251e264adca5407792f63191e4.tar.xz linux-02bc35672b2fdf251e264adca5407792f63191e4.zip |
9p: Fix possible memleak in v9fs_inode_from fid.
Add missing p9stat_free in v9fs_inode_from_fid to avoid
any possible leaks.
Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/vfs_inode.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index f22668afd0d6..fac30d21851f 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -344,30 +344,25 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid, ret = NULL; st = p9_client_stat(fid); - if (IS_ERR(st)) { - err = PTR_ERR(st); - st = NULL; - goto error; - } + if (IS_ERR(st)) + return ERR_CAST(st); umode = p9mode2unixmode(v9ses, st->mode); ret = v9fs_get_inode(sb, umode); if (IS_ERR(ret)) { err = PTR_ERR(ret); - ret = NULL; goto error; } v9fs_stat2inode(st, ret, sb); ret->i_ino = v9fs_qid2ino(&st->qid); + p9stat_free(st); kfree(st); return ret; error: + p9stat_free(st); kfree(st); - if (ret) - iput(ret); - return ERR_PTR(err); } |