Re: Oops in CDC ACM after an Openmoko phone (neo1973) changes its usb interface from ACM to Ethernet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag, 3. August 2009 23:39:29 schrieb Alex Riesen:
> Oliver Neukum, Mon, Aug 03, 2009 23:02:26 +0200:
> > > The instrumentation patch:
> >
> > Please test this patch.
>
> It does not oops immediately, but shortly afterward random
> processes start crashing, mounting a file system causes all
> kinds of weird things to happen (mentioning terrible things
> like "protection fault" and "hardirq"), and system freezes
> eventually.
>
> Feels like a poisoned dart.

Looks like a wild pointer. Please try this version.

	Regards
		Oliver

--

commit 6962e2181b38261d86002210b20af75f78c1266c
Author: Oliver Neukum <oliver@xxxxxxxxxx>
Date:   Tue Aug 4 09:36:03 2009 +0200

    usb: cdc-acm: catch usb_enable_endpoint nulling the array of endpoints

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e1f8941..757abc3 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -465,6 +465,14 @@ urbs:
 
 		ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out)
 				[usb_pipeendpoint(acm->rx_endpoint)];
+		if (!ep) { /* disconnected ? */
+			spin_lock_irqsave(&acm->read_lock, flags);
+			list_add(&buf->list, &acm->spare_read_bufs);
+			list_add(&rcv->list, &acm->spare_read_urbs);
+			acm->processing = 0;
+			spin_unlock_irqrestore(&acm->read_lock, flags);
+			return;
+		}
 		if (usb_endpoint_xfer_int(&ep->desc))
 			usb_fill_int_urb(rcv->urb, acm->dev,
 					 acm->rx_endpoint,

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux