summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-01-24 11:45:14 +0100
committerJean-Francois Moine <moinejf@free.fr>2009-01-24 11:45:14 +0100
commit5c23c4c25b7a5368c45f7ee2c0c5dedaf6af346a (patch)
tree27fdd96ad9b7bc85e962ce13d3bf9e9a09b28038 /linux/drivers
parent4de91ec44b5304ed77f6f65118680f0e70b83c9d (diff)
downloadmediapointer-dvb-s2-5c23c4c25b7a5368c45f7ee2c0c5dedaf6af346a.tar.gz
mediapointer-dvb-s2-5c23c4c25b7a5368c45f7ee2c0c5dedaf6af346a.tar.bz2
gspca - main: Fix memory leak when USB disconnection while streaming.
From: Jean-Francois Moine <moinejf@free.fr> 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 <moinejf@free.fr>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/gspca/gspca.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index c3ea5339c..4756175e4 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -434,7 +434,8 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
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_interface *intf)
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
gspca_dev->present = 0;
- gspca_dev->streaming = 0;
usb_set_intfdata(intf, NULL);