]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Wed, 15 Apr 2015 11:42:19 +0000 (13:42 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 7 Sep 2015 11:41:03 +0000 (13:41 +0200)
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>
drivers/usb/gadget/f_thor.c

index 2596b2ee4ab4e3d9f969659ee9595dcd1bc23129..06139ee04d2123f15d44a7613094e168962acb95 100644 (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;