From: Siva Durga Prasad Paladugu Date: Mon, 8 Sep 2014 16:39:39 +0000 (+0530) Subject: usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4cb3a0d9b130c7583562db618fb2167f1c82ffea;p=thirdparty%2Fu-boot.git usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket as the descriptors data depend on the number of descriptors and this 64 bytes were not enough and the buffer might overflow which results in memalign failures later. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index 4e06273f7fb..76584127a8a 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -765,7 +765,7 @@ static int thor_func_bind(struct usb_configuration *c, struct usb_function *f) goto fail; } dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, - gadget->ep0->maxpacket); + THOR_PACKET_SIZE); if (!dev->req->buf) { status = -ENOMEM; goto fail;