Re: usb-uhci forgets to destroy kmem entries

From: Oleg Drokin (green@ixcelerator.com)
Date: Sat Sep 16 2000 - 05:42:05 EST


Hello!

On Fri, Sep 15, 2000 at 10:04:59PM +0200, Manfred Spraul wrote:

> > +#ifdef DEBUG_SLAB
> > + if (retval < 0 ) {
> > + if(kmem_cache_destroy(uhci_desc_kmem))
> Why only #ifdef DEBUG_SLAB?
> AFAICS the driver should always destroy it's slab cache.
Because we have such construction in usb-uhci.c::uhci_init():

#ifdef DEBUG_SLAB

        uhci_desc_kmem = kmem_cache_create("uhci_desc", sizeof(uhci_desc_t), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);

        if(!uhci_desc_kmem) {
                err("kmem_cache_create for uhci_desc failed (out of memory)");
                return -ENOMEM;
        }

        urb_priv_kmem = kmem_cache_create("urb_priv", sizeof(urb_priv_t), 0, SLAB_HWCACHE_ALIGN, NULL, NULL);

        if(!urb_priv_kmem) {
                err("kmem_cache_create for urb_priv_t failed (out of memory)");
                return -ENOMEM;
        }
#endif

And DEBUG_SLAB is unconditionally defined in the beginning of usb-uhci.c, too

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



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:12 EST