From: Adrian Bunk Date: Thu, 8 Feb 2007 22:20:38 +0000 (-0800) Subject: [PATCH] v9fs_vfs_mkdir(): fix a double free X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=835d90c4218dffe6f9e7ac1ed79795197a4970c4;p=linux-beck.git [PATCH] v9fs_vfs_mkdir(): fix a double free Fix a double free of "dfid" introduced by commit da977b2c7eb4d6312f063a7b486f2aad99809710 and spotted by the Coverity checker. Signed-off-by: Adrian Bunk Cc: Eric Van Hensbergen Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 9109ba1d6969..378767c07bf1 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -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);