Thread (1 message) 1 message, 1 author, 2004-02-04

Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2004-02-04 21:47:40

chas williams [off-list ref] :
randy, i think it should probably return -ENOMEM instead of -1.
One should probably apply the following patch on top of it btw.



Unbalanced call to create_proc_entry() on error path.


 net/atm/clip.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN net/atm/clip.c~clip-procfs-leak net/atm/clip.c
--- linux-2.6.2-rc3/net/atm/clip.c~clip-procfs-leak	2004-02-04 22:41:42.000000000 +0100
+++ linux-2.6.2-rc3-fr/net/atm/clip.c	2004-02-04 22:43:33.000000000 +0100
@@ -1021,8 +1021,10 @@ static int __init atm_clip_init(void)
 	clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id,
 	    clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
 
-	if (!clip_tbl.kmem_cachep)
+	if (!clip_tbl.kmem_cachep) {
+		remove_proc_entry("arp", atm_proc_root);
 		return -ENOMEM;
+	}
 
 	/* so neigh_ifdown() doesn't complain */
 	clip_tbl.proxy_timer.data = 0;
_
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help