patch-2.3.99-pre8 linux/drivers/usb/uhci.c

Next file: linux/drivers/video/acornfb.c
Previous file: linux/drivers/usb/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre7/linux/drivers/usb/uhci.c linux/drivers/usb/uhci.c
@@ -289,10 +289,10 @@
 	if (!list_empty(&td->list))
 		dbg("td is still in URB list!");
 
-	kmem_cache_free(uhci_td_cachep, td);
-
 	if (td->dev)
 		usb_dec_dev_use(td->dev);
+
+	kmem_cache_free(uhci_td_cachep, td);
 }
 
 static struct uhci_qh *uhci_alloc_qh(struct usb_device *dev)
@@ -318,10 +318,10 @@
 
 static void uhci_free_qh(struct uhci_qh *qh)
 {
-	kmem_cache_free(uhci_qh_cachep, qh);
-
 	if (qh->dev)
 		usb_dec_dev_use(qh->dev);
+
+	kmem_cache_free(uhci_qh_cachep, qh);
 }
 
 static void uhci_insert_qh(struct uhci *uhci, struct uhci_qh *skelqh, struct uhci_qh *qh)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)