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>
This commit is contained in:
Abhishek Kulkarni 2009-07-19 13:41:54 -06:00 committed by Eric Van Hensbergen
parent 0e15597ebf
commit 02bc35672b

View file

@ -344,30 +344,25 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
ret = NULL; ret = NULL;
st = p9_client_stat(fid); st = p9_client_stat(fid);
if (IS_ERR(st)) { if (IS_ERR(st))
err = PTR_ERR(st); return ERR_CAST(st);
st = NULL;
goto error;
}
umode = p9mode2unixmode(v9ses, st->mode); umode = p9mode2unixmode(v9ses, st->mode);
ret = v9fs_get_inode(sb, umode); ret = v9fs_get_inode(sb, umode);
if (IS_ERR(ret)) { if (IS_ERR(ret)) {
err = PTR_ERR(ret); err = PTR_ERR(ret);
ret = NULL;
goto error; goto error;
} }
v9fs_stat2inode(st, ret, sb); v9fs_stat2inode(st, ret, sb);
ret->i_ino = v9fs_qid2ino(&st->qid); ret->i_ino = v9fs_qid2ino(&st->qid);
p9stat_free(st);
kfree(st); kfree(st);
return ret; return ret;
error: error:
p9stat_free(st);
kfree(st); kfree(st);
if (ret)
iput(ret);
return ERR_PTR(err); return ERR_PTR(err);
} }