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 <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Siva Durga Prasad Paladugu 2015-04-15 13:42:19 +02:00 committed by Marek Vasut
parent 41d237de6a
commit 58f99df448
1 changed files with 1 additions and 1 deletions

View File

@ -775,7 +775,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;