From: Rusty Russell When ipt_registrater_match() fails, ipt_recent doesn't remove its proc entry. Found by nfsim. Signed-off-by: Rusty Russell Signed-off-by: Andrew Morton --- 25-akpm/net/ipv4/netfilter/ipt_recent.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -puN net/ipv4/netfilter/ipt_recent.c~netfilter-fix-cleanup-in-ipt_recent-should-ipt_registrater_match-error net/ipv4/netfilter/ipt_recent.c --- 25/net/ipv4/netfilter/ipt_recent.c~netfilter-fix-cleanup-in-ipt_recent-should-ipt_registrater_match-error 2005-01-01 01:27:02.769408072 -0800 +++ 25-akpm/net/ipv4/netfilter/ipt_recent.c 2005-01-01 01:27:02.773407464 -0800 @@ -959,7 +959,7 @@ static struct ipt_match recent_match = { /* Kernel module initialization. */ static int __init init(void) { - int count; + int err, count; printk(version); #ifdef CONFIG_PROC_FS @@ -983,7 +983,10 @@ static int __init init(void) if(debug) printk(KERN_INFO RECENT_NAME ": ip_list_hash_size: %d\n",ip_list_hash_size); #endif - return ipt_register_match(&recent_match); + err = ipt_register_match(&recent_match); + if (err) + remove_proc_entry("ipt_recent", proc_net); + return err; } /* Kernel module destruction. */ _