<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># 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.375   -&gt; 1.376  
#	drivers/usb/usb-ohci.c	1.25    -&gt; 1.26   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/02/20	greg@kroah.com	1.376
# usb usb-ohci.c:
# 	- added usb_put_urb() and usb_get_urb() logic
# --------------------------------------------
#
diff -Nru a/drivers/usb/usb-ohci.c b/drivers/usb/usb-ohci.c
--- a/drivers/usb/usb-ohci.c	Wed Feb 20 16:55:01 2002
+++ b/drivers/usb/usb-ohci.c	Wed Feb 20 16:55:01 2002
@@ -205,6 +205,7 @@
 		urb_free_priv ((struct ohci *)urb-&gt;dev-&gt;bus-&gt;hcpriv, urb_priv);
 		usb_dec_dev_use (urb-&gt;dev);
 		urb-&gt;dev = NULL;
+		usb_put_urb (urb);
 	}
 }
 
@@ -553,6 +554,9 @@
 //	if(usb_endpoint_halted (urb-&gt;dev, usb_pipeendpoint (pipe), usb_pipeout (pipe))) 
 //		return -EPIPE;
 	
+	/* increment the reference count of the urb, as we now also control it */
+	urb = usb_get_urb (urb);
+
 	usb_inc_dev_use (urb-&gt;dev);
 	ohci = (ohci_t *) urb-&gt;dev-&gt;bus-&gt;hcpriv;
 	
@@ -568,12 +572,14 @@
 	 * such as powering down ports */
 	if (ohci-&gt;disabled) {
 		usb_dec_dev_use (urb-&gt;dev);	
+		usb_put_urb (urb);
 		return -ESHUTDOWN;
 	}
 
 	/* every endpoint has a ed, locate and fill it */
 	if (!(ed = ep_add_ed (urb-&gt;dev, pipe, urb-&gt;interval, 1, mem_flags))) {
 		usb_dec_dev_use (urb-&gt;dev);	
+		usb_put_urb (urb);
 		return -ENOMEM;
 	}
 
@@ -595,6 +601,7 @@
 			size = urb-&gt;number_of_packets;
 			if (size &lt;= 0) {
 				usb_dec_dev_use (urb-&gt;dev);	
+				usb_put_urb (urb);
 				return -EINVAL;
 			}
 			for (i = 0; i &lt; urb-&gt;number_of_packets; i++) {
@@ -615,6 +622,7 @@
 	urb_priv = kmalloc (sizeof (urb_priv_t) + size * sizeof (td_t *), mem_flags);
 	if (!urb_priv) {
 		usb_dec_dev_use (urb-&gt;dev);	
+		usb_put_urb (urb);
 		return -ENOMEM;
 	}
 	memset (urb_priv, 0, sizeof (urb_priv_t) + size * sizeof (td_t *));
@@ -632,6 +640,7 @@
 			urb_free_priv (ohci, urb_priv);
 			spin_unlock_irqrestore (&amp;usb_ed_lock, flags);
 			usb_dec_dev_use (urb-&gt;dev);	
+			usb_put_urb (urb);
 			return -ENOMEM;
 		}
 	}	
@@ -640,6 +649,7 @@
 		urb_free_priv (ohci, urb_priv);
 		spin_unlock_irqrestore (&amp;usb_ed_lock, flags);
 		usb_dec_dev_use (urb-&gt;dev);	
+		usb_put_urb (urb);
 		return -EINVAL;
 	}
 	
@@ -662,6 +672,7 @@
 				urb_free_priv (ohci, urb_priv);
 				spin_unlock_irqrestore (&amp;usb_ed_lock, flags);
 				usb_dec_dev_use (urb-&gt;dev);	
+				usb_put_urb (urb);
 				return bustime;
 			}
 			usb_claim_bandwidth (urb-&gt;dev, urb, bustime, usb_pipeisoc (urb-&gt;pipe));
@@ -2100,6 +2111,7 @@
 	urb-&gt;dev = NULL;
 	if (urb-&gt;complete)
 	    	urb-&gt;complete (urb);
+	usb_put_urb (urb);
 	return 0;
 }
 
@@ -2123,6 +2135,7 @@
 				urb-&gt;complete (urb);
 		} else
 			urb-&gt;status = -ENOENT;
+		usb_put_urb (urb);
 	}
 	return 0;
 }
</pre></body></html>