Commit 835d90c4 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] v9fs_vfs_mkdir(): fix a double free

Fix a double free of "dfid" introduced by commit
da977b2c and spotted by the Coverity
checker.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent da6e1a32
...@@ -585,17 +585,14 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -585,17 +585,14 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
if (IS_ERR(inode)) { if (IS_ERR(inode)) {
err = PTR_ERR(inode); err = PTR_ERR(inode);
inode = NULL; inode = NULL;
goto clean_up_fids; v9fs_fid_destroy(vfid);
goto error;
} }
dentry->d_op = &v9fs_dentry_operations; dentry->d_op = &v9fs_dentry_operations;
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
return 0; return 0;
clean_up_fids:
if (vfid)
v9fs_fid_destroy(vfid);
clean_up_dfid: clean_up_dfid:
v9fs_fid_clunk(v9ses, dfid); v9fs_fid_clunk(v9ses, dfid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment