netdev
[Top] [All Lists]

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

To: chas williams <chas@xxxxxxxxxxxxxxxx>
Subject: Re: Fw: [Kernel-janitors] net/atm/clip.c: check kmem_cache_create() #1
From: Francois Romieu <romieu@xxxxxxxxxxxxx>
Date: Wed, 4 Feb 2004 22:47:40 +0100
Cc: davem@xxxxxxxxxx, "Randy.Dunlap" <rddunlap@xxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Wed, Feb 04, 2004 at 02:04:17PM -0500
References: <rddunlap@osdl.org> <200402041904.i14J4GRr017777@ginger.cmf.nrl.navy.mil>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
chas williams <chas@xxxxxxxxxxxxxxxx> :
> 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;

_


<Prev in Thread] Current Thread [Next in Thread>