The patch number 10385 was added via Jean-Francois Moine <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Jean-Francois Moine <[email protected]>
gspca - main: Fix memory leak when USB disconnection while streaming.
Resetting the streaming flag on disconnection prevented the URBs to be freed
when streaming was active.
Also, USBs cannot be killed after disconnection (oops in [usbcore] unlink1).
Priority: high
Signed-off-by: Jean-Francois Moine <[email protected]>
---
linux/drivers/media/video/gspca/gspca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -r 5f9c679a138f -r 45166f043b0b linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c Fri Jan 23 18:42:03 2009 +0100
+++ b/linux/drivers/media/video/gspca/gspca.c Sat Jan 24 11:45:14 2009 +0100
@@ -434,7 +434,8 @@ static void destroy_urbs(struct gspca_de
break;
gspca_dev->urb[i] = NULL;
- usb_kill_urb(urb);
+ if (!gspca_dev->present)
+ usb_kill_urb(urb);
if (urb->transfer_buffer != NULL)
usb_buffer_free(gspca_dev->dev,
urb->transfer_buffer_length,
@@ -1952,7 +1953,6 @@ void gspca_disconnect(struct usb_interfa
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
gspca_dev->present = 0;
- gspca_dev->streaming = 0;
usb_set_intfdata(intf, NULL);
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/45166f043b0b17689eeff058b5b0366967352cb2
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits