diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-01-24 11:45:14 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-29 12:06:41 +0100 |
commit | 2fd9c2eac31d8b3c1b719c7dfbbfed17c5cbccc4 (patch) | |
tree | ca5d32900ad8498a19b6e49b5bfa2e58f05e0da7 /drivers/media | |
parent | V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and Pre-emption... (diff) | |
download | linux-2fd9c2eac31d8b3c1b719c7dfbbfed17c5cbccc4.tar.xz linux-2fd9c2eac31d8b3c1b719c7dfbbfed17c5cbccc4.zip |
V4L/DVB (10385): 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).
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 5e36b9a4ae3e..2ed24527ecd6 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -423,7 +423,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, @@ -1950,7 +1951,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); |