All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
Date: Fri, 24 Apr 2015 17:46:44 +0200	[thread overview]
Message-ID: <20150424174644.784bdc1c@amdc2363> (raw)
In-Reply-To: <0cdbb683a15f4c5d3989aa1758c887f1603c83df.1429098137.git.michal.simek@xilinx.com>

Hi Michal,

> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> 
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
> index 31eec36be876..5c8f6768519c 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;

Applied to u-boot-dfu. Thanks!

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  reply	other threads:[~2015-04-24 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 11:42 [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Michal Simek
2015-04-24 15:46 ` Lukasz Majewski [this message]
2015-08-12 10:36   ` Michal Simek
2015-08-12 11:09     ` Lukasz Majewski
2015-08-12 11:14       ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150424174644.784bdc1c@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.