This is a note to let you know that I've just added the patch titled

    cifs: fix another memleak, in cifs_root_iget

to the 2.6.32-longterm tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
     cifs-fix-another-memleak-in-cifs_root_iget.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm 
tree,
please let <[email protected]> know about it.


>From 9683336a67eee5f15684a186fc85352740ccd189 Mon Sep 17 00:00:00 2001
From: Oskar Schirmer <[email protected]>
Date: Wed, 10 Nov 2010 21:06:13 +0000
Subject: cifs: fix another memleak, in cifs_root_iget

From: Oskar Schirmer <[email protected]>

commit a7851ce73b9fdef53f251420e6883cf4f3766534 upstream.

cifs_root_iget allocates full_path through
cifs_build_path_to_root, but fails to kfree it upon
cifs_get_inode_info* failure.

Make all failure exit paths traverse clean up
handling at the end of the function.

Signed-off-by: Oskar Schirmer <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Reviewed-by: Jesper Juhl <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 fs/cifs/inode.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -688,8 +688,10 @@ struct inode *cifs_root_iget(struct supe
                rc = cifs_get_inode_info(&inode, full_path, NULL, sb,
                                                xid, NULL);
 
-       if (!inode)
-               return ERR_PTR(-ENOMEM);
+       if (!inode) {
+               inode = ERR_PTR(rc);
+               goto out;
+       }
 
        if (rc && cifs_sb->tcon->ipc) {
                cFYI(1, ("ipc connection - fake read inode"));
@@ -700,13 +702,11 @@ struct inode *cifs_root_iget(struct supe
                inode->i_uid = cifs_sb->mnt_uid;
                inode->i_gid = cifs_sb->mnt_gid;
        } else if (rc) {
-               kfree(full_path);
-               _FreeXid(xid);
                iget_failed(inode);
-               return ERR_PTR(rc);
+               inode = ERR_PTR(rc);
        }
 
-
+out:
        kfree(full_path);
        /* can not call macro FreeXid here since in a void func
         * TODO: This is no longer true


Patches currently in longterm-queue-2.6.32 which might be from [email protected] 
are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cifs-fix-another-memleak-in-cifs_root_iget.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to