diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-18 04:33:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-24 09:01:07 -0500 |
commit | 98522a7be97f2b23451342e36c39f412f0461e24 (patch) | |
tree | 49da3f3aa6d3b2ffc2cd6143cbcbd79de3b7be51 /drivers/media/video/gspca/spca561.c | |
parent | 818a557eeb9c16a9a2dc93df348b0ff68fbc487f (diff) |
V4L/DVB (9689): gspca: Memory leak when disconnect while streaming.
As a side effect, the sd routine stop0 is called on disconnect.
This permits the subdriver to free its resources.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/spca561.c')
-rw-r--r-- | drivers/media/video/gspca/spca561.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c index 020a03c466c1..c3de4e44123d 100644 --- a/drivers/media/video/gspca/spca561.c +++ b/drivers/media/video/gspca/spca561.c | |||
@@ -766,10 +766,13 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
766 | } | 766 | } |
767 | } | 767 | } |
768 | 768 | ||
769 | /* called on streamoff with alt 0 and on disconnect */ | ||
769 | static void sd_stop0(struct gspca_dev *gspca_dev) | 770 | static void sd_stop0(struct gspca_dev *gspca_dev) |
770 | { | 771 | { |
771 | struct sd *sd = (struct sd *) gspca_dev; | 772 | struct sd *sd = (struct sd *) gspca_dev; |
772 | 773 | ||
774 | if (!gspca_dev->present) | ||
775 | return; | ||
773 | if (sd->chip_revision == Rev012A) { | 776 | if (sd->chip_revision == Rev012A) { |
774 | reg_w_val(gspca_dev->dev, 0x8118, 0x29); | 777 | reg_w_val(gspca_dev->dev, 0x8118, 0x29); |
775 | reg_w_val(gspca_dev->dev, 0x8114, 0x08); | 778 | reg_w_val(gspca_dev->dev, 0x8114, 0x08); |