RE: [PATCH v3 1/2] staging: dwc2: validate urb->actual_length for OUT endpoints

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

 



> From: Felipe Balbi [mailto:balbi@xxxxxx]
> Sent: Monday, September 23, 2013 2:45 PM
> 
> On Mon, Sep 23, 2013 at 02:23:33PM -0700, Paul Zimmerman wrote:
> > In dwc2_assign_and_init_hc(), validate urb->actual_length for OUT
> > endpoints before using the value. This fix is from the Synopsys
> > vendor driver.
> >
> > Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx>
> > ---
> >  drivers/staging/dwc2/hcd.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
> > index da0d35c..b245405 100644
> > --- a/drivers/staging/dwc2/hcd.c
> > +++ b/drivers/staging/dwc2/hcd.c
> > @@ -780,6 +780,10 @@ static void dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg,
> >  	chan->data_pid_start = qh->data_toggle;
> >  	chan->multi_count = 1;
> >
> > +	if ((urb->actual_length < 0 || urb->actual_length > urb->length) &&
> > +	    !dwc2_hcd_is_pipe_in(&urb->pipe_info))
> > +		urb->actual_length = urb->length;
> 
> weird, why would actual_length be less than zero or greather than
> urb->length ? I guess you need some more "meat" in your commit log.

I assume it was to fix some issue seen by our developers. We don't have
detailed commit logs for that driver, so I am unable to say for certain.
But since it is part of the downstream RaspberryPi driver, which has
seen a lot of testing, I thought it best to include it.

-- 
Paul

--
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