summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/vc032x.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-11-18 10:33:08 +0100
committerJean-Francois Moine <moinejf@free.fr>2008-11-18 10:33:08 +0100
commit7830a441c0d4f9753dea8a72466091346ded739b (patch)
treea0e6285da2d73ae5b22d406c9a08db52e5f64ae7 /linux/drivers/media/video/gspca/vc032x.c
parent47b954968656ce2ddac212e3750a135a4b1aa581 (diff)
downloadmediapointer-dvb-s2-7830a441c0d4f9753dea8a72466091346ded739b.tar.gz
mediapointer-dvb-s2-7830a441c0d4f9753dea8a72466091346ded739b.tar.bz2
gspca: Memory leak when disconnect while streaming.
From: Jean-Francois Moine <moinejf@free.fr> As a side effect, the sd routine stop0 is called on disconnect. This permits the subdriver to free its resources. Priority: high Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/vc032x.c')
-rw-r--r--linux/drivers/media/video/gspca/vc032x.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c
index 95531138e..f6fae60ae 100644
--- a/linux/drivers/media/video/gspca/vc032x.c
+++ b/linux/drivers/media/video/gspca/vc032x.c
@@ -1830,10 +1830,13 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
reg_w(dev, 0xa0, 0x09, 0xb003);
}
+/* called on streamoff with alt 0 and on disconnect */
static void sd_stop0(struct gspca_dev *gspca_dev)
{
struct usb_device *dev = gspca_dev->dev;
+ if (!gspca_dev->present)
+ return;
reg_w(dev, 0x89, 0xffff, 0xffff);
}