Mattia Dongili wrote:
That would be great, but I can't see any patch attached :)


Index: linux/drivers/usb/core/urb.c
===================================================================
--- linux.orig/drivers/usb/core/urb.c
+++ linux/drivers/usb/core/urb.c
@@ -224,8 +224,10 @@ int usb_submit_urb(struct urb *urb, gfp_
 	struct usb_operations	*op;
 	int			is_out;
 
-	if (!urb || urb->hcpriv || !urb->complete)
+	if (!urb || urb->hcpriv || !urb->complete) {
+		printk("bad urb\n");
 		return -EINVAL;
+	}
 	if (!(dev = urb->dev) ||
 	    (dev->state < USB_STATE_DEFAULT) ||
 	    (!dev->bus) || (dev->devnum <= 0))
@@ -279,8 +281,10 @@ int usb_submit_urb(struct urb *urb, gfp_
 			max *= mult;
 		}
 
-		if (urb->number_of_packets <= 0)		    
+		if (urb->number_of_packets <= 0) { 
+			printk("num_of_packets <= 0\n");
 			return -EINVAL;
+		}
 		for (n = 0; n < urb->number_of_packets; n++) {
 			len = urb->iso_frame_desc [n].length;
 			if (len < 0 || len > max) 
@@ -343,8 +347,10 @@ int usb_submit_urb(struct urb *urb, gfp_
 	case PIPE_ISOCHRONOUS:
 	case PIPE_INTERRUPT:
 		/* too small? */
-		if (urb->interval <= 0)
+		if (urb->interval <= 0) {
+			printk("too small\n");
 			return -EINVAL;
+		}
 		/* too big? */
 		switch (dev->speed) {
 		case USB_SPEED_HIGH:	/* units are microframes */
@@ -356,8 +362,10 @@ int usb_submit_urb(struct urb *urb, gfp_
 		case USB_SPEED_FULL:	/* units are frames/msec */
 		case USB_SPEED_LOW:
 			if (temp == PIPE_INTERRUPT) {
-				if (urb->interval > 255)
+				if (urb->interval > 255) {
+					printk("too big\n");
 					return -EINVAL;
+				}
 				// NOTE ohci only handles up to 32
 				temp = 128;
 			} else {
@@ -368,6 +376,7 @@ int usb_submit_urb(struct urb *urb, gfp_
 			}
 			break;
 		default:
+			printk("unknown speed\n");
 			return -EINVAL;
 		}
 		/* power of two? */
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Zd1211-devs mailing list - http://zd1211.ath.cx/
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/zd1211-devs

Reply via email to