Re: Kernel OOPS in usb_submit_urb in drivers/usb/core/urb.c

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

 



On чет, 26 јул 2012 23:32:48 CEST, Greg KH wrote:
On Thu, Jul 26, 2012 at 11:25:44PM +0200, Damjan wrote:
While playing with my custom made i2c-tiny-usb adapter I triggered
this kernel OOPS in usb_submit_urb in the drivers/usb/core/urb.c
file.

 From looking at the file, before line 329 it needs to check if
&ep->desc is NULL, before it sends it to the usb_endpoint_type
(inline) function.

As seen in the oops, I suppose that it tried to send some usb
packets even after the device got disconnected, which is another
problem, but it still shouldn't oops the kernel.

The attached patch, seems to fix the usb_submit_urb/usbcore part of
the problem just fine.

I'm just not sure if -EINVAL is a correct error number to return?

How did you continue to send data to the device if the device is gone?
Did you forget to stop a timer or something?

Odds are the device is long cleaned up, so you might need to just ensure
that you have a reference to the device if you keep a pointer to it so
this doesn't happen in the future.  Do you have a pointer to your driver
anywhere?

The driver is i2c-tiny-usb (as seen in the stack trace). It ships with the vanilla kernel since 2007 I think.
drivers/i2c/busses/i2c-tiny-usb.c

I've triggered this issue while hacking on the firmware for an attiny25 micro-controller that the driver communicates with. I know my firmware was broken for sure, but that's another story.

I've not debug-ed the driver itself yet. I just thought that extra check in urb.c should be added first.



--
дамјан
--
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