lkml.org 
[lkml]   [2000]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectusb-uhci forgets to destroy kmem entries
Hello!

I do not know, if anybody really uses this driver ('UHCI (Intel PIIX4, VIA,
...) support'), but based one the name, I choosen it, and found, that when it
cannot find any USB host, it forgots to do kmem_destroy_..., and
because of that any subsequent attempts to load usb-uhci modules ends up
with BUG in slab.c.
Here is the patch, below. It is against 2.4.0-test8.

--- drivers/usb/usb-uhci.c.orig Wed Sep 13 17:36:20 2000
+++ drivers/usb/usb-uhci.c Wed Sep 13 18:34:33 2000
@@ -2842,6 +2842,7 @@

if(!urb_priv_kmem) {
err("kmem_cache_create for urb_priv_t failed (out of memory)");
+ kmem_cache_destroy(urb_priv_kmem);
return -ENOMEM;
}
#endif
@@ -2876,6 +2877,15 @@
i++;
}

+#ifdef DEBUG_SLAB
+ if (retval < 0 ) {
+ if(kmem_cache_destroy(uhci_desc_kmem))
+ err("uhci_desc_kmem remained");
+ if(kmem_cache_destroy(urb_priv_kmem))
+ err("urb_priv_kmem remained");
+ }
+#endif
+
return retval;
}

-
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/
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.020 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site