]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.20.2/v9fs_vfs_mkdir-fix-a-double-free.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / v9fs_vfs_mkdir-fix-a-double-free.patch
1 From stable-bounces@linux.kernel.org Thu Feb 8 14:22:20 2007
2 From: Adrian Bunk <bunk@stusta.de>
3 Date: Thu, 08 Feb 2007 14:20:38 -0800
4 Subject: v9fs_vfs_mkdir(): fix a double free
5 To: torvalds@linux-foundation.org
6 Cc: ericvh@gmail.com, akpm@linux-foundation.org, stable@kernel.org, bunk@stusta.de
7 Message-ID: <200702082220.l18MKcCN028498@shell0.pdx.osdl.net>
8
9
10 From: Adrian Bunk <bunk@stusta.de>
11
12 Fix a double free of "dfid" introduced by commit
13 da977b2c7eb4d6312f063a7b486f2aad99809710 and spotted by the Coverity
14 checker.
15
16 Signed-off-by: Adrian Bunk <bunk@stusta.de>
17 Cc: Eric Van Hensbergen <ericvh@gmail.com>
18 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 ---
21
22 fs/9p/vfs_inode.c | 7 ++-----
23 1 file changed, 2 insertions(+), 5 deletions(-)
24
25 --- linux-2.6.20.1.orig/fs/9p/vfs_inode.c
26 +++ linux-2.6.20.1/fs/9p/vfs_inode.c
27 @@ -585,17 +585,14 @@ static int v9fs_vfs_mkdir(struct inode *
28 if (IS_ERR(inode)) {
29 err = PTR_ERR(inode);
30 inode = NULL;
31 - goto clean_up_fids;
32 + v9fs_fid_destroy(vfid);
33 + goto error;
34 }
35
36 dentry->d_op = &v9fs_dentry_operations;
37 d_instantiate(dentry, inode);
38 return 0;
39
40 -clean_up_fids:
41 - if (vfid)
42 - v9fs_fid_destroy(vfid);
43 -
44 clean_up_dfid:
45 v9fs_fid_clunk(v9ses, dfid);
46