summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-20 11:25:22 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-07-20 11:25:22 +0200
commitfe6ee54582737eb02f62ebdec950ba397873c644 (patch)
tree061082e4bcacae7b1cd5b13f98df2c8541efd8b0 /linux/drivers/media/video
parent66bdbb2c4fd4d078e0497e4643e20ecd3eab6622 (diff)
downloadmediapointer-dvb-s2-fe6ee54582737eb02f62ebdec950ba397873c644.tar.gz
mediapointer-dvb-s2-fe6ee54582737eb02f62ebdec950ba397873c644.tar.bz2
wm8775/wm8739: Fix memory leak when unloading module
From: Hans Verkuil <hverkuil@xs4all.nl> State struct was never freed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/wm8739.c2
-rw-r--r--linux/drivers/media/video/wm8775.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/linux/drivers/media/video/wm8739.c b/linux/drivers/media/video/wm8739.c
index da14fa401..999c25a30 100644
--- a/linux/drivers/media/video/wm8739.c
+++ b/linux/drivers/media/video/wm8739.c
@@ -348,12 +348,14 @@ static int wm8739_probe(struct i2c_adapter *adapter)
static int wm8739_detach(struct i2c_client *client)
{
+ struct wm8739_state *state = i2c_get_clientdata(client);
int err;
err = i2c_detach_client(client);
if (err)
return err;
+ kfree(state);
kfree(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_DEC_USE_COUNT;
diff --git a/linux/drivers/media/video/wm8775.c b/linux/drivers/media/video/wm8775.c
index 4727cbd6d..7e3734f00 100644
--- a/linux/drivers/media/video/wm8775.c
+++ b/linux/drivers/media/video/wm8775.c
@@ -245,12 +245,14 @@ static int wm8775_probe(struct i2c_adapter *adapter)
static int wm8775_detach(struct i2c_client *client)
{
+ struct wm8775_state *state = i2c_get_clientdata(client);
int err;
err = i2c_detach_client(client);
if (err) {
return err;
}
+ kfree(state);
kfree(client);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)