Re: [PATCH v2 6/6] Revert "usb: udc: allow adding and removing the same gadget device"

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

 



On Mon, Aug 10, 2020 at 10:25:10AM +0800, Peter Chen wrote:
> We have already allocated gadget structure dynamically at UDC (dwc3)
> driver, so commit fac323471df6 ("usb: udc: allow adding and removing
> the same gadget device")could be reverted.
> 
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Peter Chen <peter.chen@xxxxxxx>
> ---
> Changes from v1:
> - No changes.
> 
>  drivers/usb/gadget/udc/core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
> index 473e74088b1f..43351b0af569 100644
> --- a/drivers/usb/gadget/udc/core.c
> +++ b/drivers/usb/gadget/udc/core.c
> @@ -1386,7 +1386,6 @@ void usb_del_gadget_udc(struct usb_gadget *gadget)
>  {
>  	usb_del_gadget(gadget);
>  	usb_put_gadget(gadget);
> -	memset(&gadget->dev, 0x00, sizeof(gadget->dev));

Shouldn't you do this patch earlier in the series, as the
usb_put_gadget() call could have freed the memory that is being cleared
here?

Otherwise, this series looks good, thanks for doing it.

greg k-h



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

  Powered by Linux