]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 8 Sep 2014 16:39:39 +0000 (22:09 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 10 Sep 2014 09:03:50 +0000 (11:03 +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 4e06273f7fb7e678b96a6bb3e11d6b8d6a4830a5..76584127a8a4474af4e6ea3702e227083fd320eb 100644 (file)
@@ -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;