Re: [PATCH 1/7] usb: misc: usbtest: allocate size of urb array according to user parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 31, 2015 at 03:17:06PM +0200, Oliver Neukum wrote:
> On Mon, 2015-08-31 at 13:01 +0200, Michal Nazarewicz wrote:
> > On Fri, Aug 28 2015, Peter Chen wrote:
> > > Allocate the size of urb pointer array according to testusb's
> > > parameter sglen.
> > >
> > > Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>
> > 
> > Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>
> > 
> > I vaguely recall that LLVM fans got mad last time I used dynamically
> > sized local arrays though.  Not sure though, I may be misremembering
> > things.
> > 
> > > ---
> > >  drivers/usb/misc/usbtest.c | 5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> > > index 9517812..9cdb4ad 100644
> > > --- a/drivers/usb/misc/usbtest.c
> > > +++ b/drivers/usb/misc/usbtest.c
> > > @@ -1911,10 +1911,7 @@ test_iso_queue(struct usbtest_dev *dev,
> > struct usbtest_param *param,
> > >       unsigned                i;
> > >       unsigned long           packets = 0;
> > >       int                     status = 0;
> > > -     struct urb              *urbs[10];      /* FIXME no limit */
> > > -
> > > -     if (param->sglen > 10)
> > > -             return -EDOM;
> > > +     struct urb              *urbs[param->sglen];
> 
> This goes onto the stack. Do you have any limit on sglen?
> 

I will add 128 (so 512 bytes) as limitation.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux