[PATCH 2/8] autofs4-2.6 - to support autofs 4.1.x

From: raven
Date: Wed Jan 28 2004 - 10:43:48 EST



Patch:

2-autofs4-2.6.0-test9-fill_super.patch

Fix memory leak in autofs4_fill_super function.

diff -Nur linux-2.6.0-0.test9.expire/fs/autofs4/inode.c linux-2.6.0-0.test9.fill_super/fs/autofs4/inode.c
--- linux-2.6.0-0.test9.expire/fs/autofs4/inode.c 2003-10-26 02:44:12.000000000 +0800
+++ linux-2.6.0-0.test9.fill_super/fs/autofs4/inode.c 2003-11-15 09:26:41.000000000 +0800
@@ -187,6 +187,7 @@
struct file * pipe;
int pipefd;
struct autofs_sb_info *sbi;
+ struct autofs_info *ino;
int minproto, maxproto;

sbi = (struct autofs_sb_info *) kmalloc(sizeof(*sbi), GFP_KERNEL);
@@ -212,7 +213,9 @@
/*
* Get the root inode and dentry, but defer checking for errors.
*/
- root_inode = autofs4_get_inode(s, autofs4_mkroot(sbi));
+ ino = autofs4_mkroot(sbi);
+ root_inode = autofs4_get_inode(s, ino);
+ kfree(ino);
root_inode->i_op = &autofs4_root_inode_operations;
root_inode->i_fop = &autofs4_root_operations;
root = d_alloc_root(root_inode);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/