1 From a7851ce73b9fdef53f251420e6883cf4f3766534 Mon Sep 17 00:00:00 2001
2 From: Oskar Schirmer <oskar@scara.com>
3 Date: Wed, 10 Nov 2010 21:06:13 +0000
4 Subject: cifs: fix another memleak, in cifs_root_iget
6 From: Oskar Schirmer <oskar@scara.com>
8 commit a7851ce73b9fdef53f251420e6883cf4f3766534 upstream.
10 cifs_root_iget allocates full_path through
11 cifs_build_path_to_root, but fails to kfree it upon
12 cifs_get_inode_info* failure.
14 Make all failure exit paths traverse clean up
15 handling at the end of the function.
17 Signed-off-by: Oskar Schirmer <oskar@scara.com>
18 Reviewed-by: Jesper Juhl <jj@chaosbits.net>
19 Signed-off-by: Steve French <sfrench@us.ibm.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23 fs/cifs/inode.c | 12 ++++++------
24 1 file changed, 6 insertions(+), 6 deletions(-)
28 @@ -835,8 +835,10 @@ struct inode *cifs_root_iget(struct supe
29 rc = cifs_get_inode_info(&inode, full_path, NULL, sb,
35 + inode = ERR_PTR(rc);
39 #ifdef CONFIG_CIFS_FSCACHE
40 /* populate tcon->resource_id */
41 @@ -852,13 +854,11 @@ struct inode *cifs_root_iget(struct supe
42 inode->i_uid = cifs_sb->mnt_uid;
43 inode->i_gid = cifs_sb->mnt_gid;
49 + inode = ERR_PTR(rc);
55 /* can not call macro FreeXid here since in a void func
56 * TODO: This is no longer true