Re: [PATCH] usb: gadget: dummy: don't disconnect on gadget removal

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

 



On Wed, 18 Apr 2012 13:48:40 +0300, Felipe Balbi <balbi@xxxxxx> wrote:
> On Tue, Apr 17, 2012 at 05:02:30PM +0300, Alexander Shishkin wrote:
> > Currently, on gadget removal path, dummy_pullup() gets called after
> > gadget's disconnect(). Now, dummy_pullup() decides that it needs to
> > disconnect again, resulting in a crash. IOW, rmmod g_zero will crash
> > with dummy_hcd.
> 
> Isn't the fix then simply:

Nope. It never reaches dummy_udc_stop(), because dummy_pullup() that
crashes the kernel is called before it.

> diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
> index a6dfd21..170cbe8 100644
> --- a/drivers/usb/gadget/dummy_hcd.c
> +++ b/drivers/usb/gadget/dummy_hcd.c
> @@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g,
>  
>  	dum->driver = NULL;
>  
> -	dummy_pullup(&dum->gadget, 0);
>  	return 0;
>  }

This won't make a difference, because the dum->driver in NULL and pullup
won't call disconnect.

Regards,
--
Alex
--
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