lkml.org 
[lkml]   [2012]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Kernel Oops while disconnecting USB peripheral (always)
On Sat, 28 Jul 2012, Daniel Mack wrote:

> Hmm, interesting. Thanks for sharing this. I personally never saw this
> bug kicking in, but if I understand your findings correctly, we would
> need something like the following patch for snd-usb and the storage driver?
>
> Sarbojit, could you give this a test and see whether your kernel still
> crashes in any of the two drivers?


> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -1025,9 +1025,14 @@ void usb_stor_disconnect(struct usb_interface *intf)
> {
> struct us_data *us = usb_get_intfdata(intf);
>
> + if (!us)
> + return;

This can never happen. The disconnect routine gets called only once,
so us will not be NULL.

> +
> US_DEBUGP("storage_disconnect() called\n");
> quiesce_and_remove_host(us);
> release_everything(us);
> +
> + usb_set_intfdata(intf, NULL);
> }
> EXPORT_SYMBOL_GPL(usb_stor_disconnect);

Alan Stern



\
 
 \ /
  Last update: 2012-07-28 19:01    [W:0.059 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site