Skip to content

Commit

Permalink
V4L/DVB (5880): wm8775/wm8739: Fix memory leak when unloading module
Browse files Browse the repository at this point in the history
State struct was never freed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 20, 2007
1 parent 2fc9e2f commit 1b2232a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/wm8739.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,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);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/wm8775.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,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);

return 0;
Expand Down

0 comments on commit 1b2232a

Please sign in to comment.