From: Erik Andren Date: Wed, 7 Jan 2009 09:09:27 +0000 (-0300) Subject: V4L/DVB (10341): gspca - stv06xx: Plug a memory leak in the pb0100 sensor driver. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d5b53f467bf5c2d0dbd5b043461275255073886d;p=linux-beck.git V4L/DVB (10341): gspca - stv06xx: Plug a memory leak in the pb0100 sensor driver. Signed-off-by: Erik Andren Signed-off-by: Jean-Francois Moine Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c index ae2d04b85604..285221e6b390 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c @@ -268,6 +268,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/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h b/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h index da7c13ed8ffb..4de4fa5ebc57 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_pb0100.h +++ b/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