# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.374   -> 1.375  
#	  drivers/usb/uhci.c	1.23    -> 1.24   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/20	greg@kroah.com	1.375
# usb uhci.c:
# 	- added usb_get_urb() and usb_put_urb() logic
# --------------------------------------------
#
diff -Nru a/drivers/usb/uhci.c b/drivers/usb/uhci.c
--- a/drivers/usb/uhci.c	Wed Feb 20 16:54:54 2002
+++ b/drivers/usb/uhci.c	Wed Feb 20 16:54:54 2002
@@ -1492,6 +1492,9 @@
 		return -ENODEV;
 	}
 
+	/* increment the reference count of the urb, as we now also control it */
+	urb = usb_get_urb(urb);
+
 	uhci = (struct uhci *)urb->dev->bus->hcpriv;
 
 	INIT_LIST_HEAD(&urb->urb_list);
@@ -1505,6 +1508,7 @@
 		/* Since we can have problems on the out path */
 		spin_unlock_irqrestore(&urb->lock, flags);
 		usb_dec_dev_use(urb->dev);
+		usb_put_urb(urb);
 
 		return ret;
 	}
@@ -2299,6 +2303,7 @@
 			/* We decrement the usage count after we're done */
 			/*  with everything */
 			usb_dec_dev_use(dev);
+			usb_put_urb(urb);
 		}
 	}
 }
