public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [UBOOT PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
@ 2014-09-05 10:09 Siva Durga Prasad Paladugu
  2014-09-24 12:28 ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Siva Durga Prasad Paladugu @ 2014-09-05 10:09 UTC (permalink / raw)
  To: u-boot

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>
---
 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 c85b0fb..98d2d8c 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -766,7 +766,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;
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [UBOOT PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
  2014-09-05 10:09 [U-Boot] [UBOOT PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Siva Durga Prasad Paladugu
@ 2014-09-24 12:28 ` Michal Simek
  2015-04-15 11:01   ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2014-09-24 12:28 UTC (permalink / raw)
  To: u-boot

On 09/05/2014 12:09 PM, Siva Durga Prasad Paladugu wrote:
> 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>
> ---
>  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 c85b0fb..98d2d8c 100644
> --- a/drivers/usb/gadget/f_thor.c
> +++ b/drivers/usb/gadget/f_thor.c
> @@ -766,7 +766,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;
> 

Tested-by: Michal Simek <monstr@monstr.eu>

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140924/d8b3079a/attachment.pgp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [UBOOT PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
  2014-09-24 12:28 ` Michal Simek
@ 2015-04-15 11:01   ` Michal Simek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2015-04-15 11:01 UTC (permalink / raw)
  To: u-boot

Hi Marek,

2014-09-24 14:28 GMT+02:00 Michal Simek <monstr@monstr.eu>:

> On 09/05/2014 12:09 PM, Siva Durga Prasad Paladugu wrote:
> > 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>
> > ---
> >  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 c85b0fb..98d2d8c 100644
> > --- a/drivers/usb/gadget/f_thor.c
> > +++ b/drivers/usb/gadget/f_thor.c
> > @@ -766,7 +766,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;
> >
>
> Tested-by: Michal Simek <monstr@monstr.eu>
>
> Thanks,
> Michal
>
>
Any update on this one?

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-15 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 10:09 [U-Boot] [UBOOT PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Siva Durga Prasad Paladugu
2014-09-24 12:28 ` Michal Simek
2015-04-15 11:01   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox