diff options
author | Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> | 2015-04-15 13:42:19 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-09-07 13:41:03 +0200 |
commit | 58f99df448501041a8092b281ff7adf0bd4f38ac (patch) | |
tree | 48d309e4ba82bb1a6ff8e41d7edc52d763c60465 /drivers/usb/gadget/f_thor.c | |
parent | 41d237de6acbd5d3a8fac106dbea2d00f044c4f9 (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget/f_thor.c')
-rw-r--r-- | drivers/usb/gadget/f_thor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index 2596b2ee4ab..06139ee04d2 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -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; |