Re: [PATCH] usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup

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

 



On Tue, Jul 15, 2014 at 10:07:40PM +0800, Li Jun wrote:
> This patch try to dequeue the cdev->req to guarantee the request is not queued
> before free it.
> 
> Signed-off-by: Li Jun <b47624@xxxxxxxxxxxxx>

I noticed the same problem when porting the latest USB gadget stack from
the Kernel to barebox.

> ---
>  drivers/usb/gadget/composite.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index f801519..6935a82 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1956,6 +1956,7 @@ void composite_dev_cleanup(struct usb_composite_dev *cdev)
>  	}
>  	if (cdev->req) {
>  		kfree(cdev->req->buf);
> +		usb_ep_dequeue(cdev->gadget->ep0, cdev->req);

The request should be dequeued before the buffer is freed, not
afterwards.

Otherwise:

Acked-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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