summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-01-07 10:09:27 +0100
committerJean-Francois Moine <moinejf@free.fr>2009-01-07 10:09:27 +0100
commit4dc396f356b2837f3295f459f2a5fb40bd178bb9 (patch)
tree2d127c6257f2c3c178b831bbb51ef8e23ad9e8b6 /linux/drivers/media
parent96bc6ac47653539f76499de79dddf3695a1abe3f (diff)
downloadmediapointer-dvb-s2-4dc396f356b2837f3295f459f2a5fb40bd178bb9.tar.gz
mediapointer-dvb-s2-4dc396f356b2837f3295f459f2a5fb40bd178bb9.tar.bz2
gspca - stv06xx: Plug a memory leak in the pb0100 sensor driver.
From: Erik Andren <erik.andren@gmail.com> Priority: normal Signed-off-by: Erik Andren <erik.andren@gmail.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c6
-rw-r--r--linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c b/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
index 7d2c41650..180f52c36 100644
--- a/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
+++ b/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
@@ -290,6 +290,12 @@ out:
return (err < 0) ? err : 0;
}
+static void pb0100_disconnect(struct sd *sd)
+{
+ sd->sensor = NULL;
+ kfree(sd->sensor_priv);
+}
+
/* FIXME: Sort the init commands out and put them into tables,
this is only for getting the camera to work */
/* FIXME: No error handling for now,
diff --git a/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h b/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
index da7c13ed8..4de4fa5eb 100644
--- a/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
+++ b/linux/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h
@@ -114,6 +114,7 @@ static int pb0100_start(struct sd *sd);
static int pb0100_init(struct sd *sd);
static int pb0100_stop(struct sd *sd);
static int pb0100_dump(struct sd *sd);
+static void pb0100_disconnect(struct sd *sd);
/* V4L2 controls supported by the driver */
static int pb0100_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
@@ -142,6 +143,7 @@ const struct stv06xx_sensor stv06xx_sensor_pb0100 = {
.start = pb0100_start,
.stop = pb0100_stop,
.dump = pb0100_dump,
+ .disconnect = pb0100_disconnect,
};
#endif