Skip to content

Commit

Permalink
[PATCH] v9fs_vfs_mkdir(): fix a double free
Browse files Browse the repository at this point in the history
Fix a double free of "dfid" introduced by commit
da977b2 and spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Feb 9, 2007
1 parent da6e1a3 commit 835d90c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,17 +585,14 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
inode = NULL;
goto clean_up_fids;
v9fs_fid_destroy(vfid);
goto error;
}

dentry->d_op = &v9fs_dentry_operations;
d_instantiate(dentry, inode);
return 0;

clean_up_fids:
if (vfid)
v9fs_fid_destroy(vfid);

clean_up_dfid:
v9fs_fid_clunk(v9ses, dfid);

Expand Down

0 comments on commit 835d90c

Please sign in to comment.