On 18:40 Sat 31 May 2008, Laurent Pinchart wrote:
> > Index: uvc/uvc_driver.c
> > ===================================================================
> > --- uvc.orig/uvc_driver.c
> > +++ uvc/uvc_driver.c
> > @@ -865,6 +865,8 @@ static int uvc_parse_standard_control(st
> >
> >                     if (uvc_parse_streaming(dev, streaming) < 0) {
> >                             usb_put_intf(intf);
> > +                           usb_driver_release_interface(&uvc_driver.driver,
> > +                                   intf);
> >                             kfree(streaming->format);
> >                             kfree(streaming->header.bmaControls);
> >                             kfree(streaming);
> > @@ -1524,6 +1526,8 @@ void uvc_delete(struct kref *kref)
> >             struct uvc_streaming *streaming;
> >             streaming = list_entry(p, struct uvc_streaming, list);
> >             usb_put_intf(streaming->intf);
> > +           usb_driver_release_interface(&uvc_driver.driver,
> > +                   streaming->intf);
> >             kfree(streaming->format);
> >             kfree(streaming->header.bmaControls);
> >             kfree(streaming);
>
> Shouldn't usb_driver_release_interface be called before usb_put_intf ? It 
> looks like the interface can be freed by usb_put_intf otherwise.

Yes that is correct; I should have seen that 8-)

> You are also missing an error path (kzalloc returning NULL right after
> claiming the interface).

Good point.

> Here is a modified version of your patch that cleans up the driver
> code a little as well. It works fine here, could you please test it ? 

The patch looks good, works for me and doesn't claim the interface with
my test.  Thanks.  I will try and get the user from the original bug to
test it too.

Signed-off-by: Brandon Philips <[EMAIL PROTECTED]>
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to