diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-18 10:33:08 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-18 10:33:08 +0100 |
commit | 7830a441c0d4f9753dea8a72466091346ded739b (patch) | |
tree | a0e6285da2d73ae5b22d406c9a08db52e5f64ae7 /linux/drivers/media/video/gspca/conex.c | |
parent | 47b954968656ce2ddac212e3750a135a4b1aa581 (diff) | |
download | mediapointer-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/conex.c')
-rw-r--r-- | linux/drivers/media/video/gspca/conex.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/conex.c b/linux/drivers/media/video/gspca/conex.c index a9d51ba7c..de28354ea 100644 --- a/linux/drivers/media/video/gspca/conex.c +++ b/linux/drivers/media/video/gspca/conex.c @@ -846,10 +846,13 @@ static int sd_start(struct gspca_dev *gspca_dev) return 0; } +/* called on streamoff with alt 0 and on disconnect */ static void sd_stop0(struct gspca_dev *gspca_dev) { int retry = 50; + if (!gspca_dev->present) + return; reg_w_val(gspca_dev, 0x0000, 0x00); reg_r(gspca_dev, 0x0002, 1); reg_w_val(gspca_dev, 0x0053, 0x00); |