# 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.546   -> 1.547  
#	  drivers/usb/uhci.c	1.27    -> 1.28   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/03/18	johannes@erdfelt.com	1.547
# [PATCH] uhci.c 2.4.19-pre3 erroneous completion callback
# 
# uhci.c would call the completion callback when the call to submit_urb
# failed. This is a rare situation.
# 
# This patch only calls the completion handler if the URB successfully
# completed immediately (as in the case of talking to the virtual root
# hub).
# 
# JE
# --------------------------------------------
#
diff -Nru a/drivers/usb/uhci.c b/drivers/usb/uhci.c
--- a/drivers/usb/uhci.c	Wed Apr  3 16:40:06 2002
+++ b/drivers/usb/uhci.c	Wed Apr  3 16:40:06 2002
@@ -1594,7 +1594,9 @@
 	spin_unlock(&urb->lock);
 	spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
 
-	uhci_call_completion(urb);
+	/* Only call completion if it was successful */
+	if (!ret)
+		uhci_call_completion(urb);
 
 	return ret;
 }
