Skip to content

Commit

Permalink
fs/9p: Add missing iput in v9fs_vfs_lookup
Browse files Browse the repository at this point in the history
Make sure we drop inode reference in the error path

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Oct 28, 2010
1 parent f5fc614 commit 9856af8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,

result = v9fs_fid_add(dentry, fid);
if (result < 0)
goto error;
goto error_iput;

inst_out:
if (v9ses->cache)
Expand All @@ -1048,6 +1048,8 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
d_add(dentry, inode);
return NULL;

error_iput:
iput(inode);
error:
p9_client_clunk(fid);

Expand Down

0 comments on commit 9856af8

Please sign in to comment.