V4L/DVB (5880): wm8775/wm8739: Fix memory leak when unloading module
State struct was never freed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
2fc9e2f78a
commit
1b2232ab87
|
@ -321,12 +321,14 @@ static int wm8739_probe(struct i2c_adapter *adapter)
|
||||||
|
|
||||||
static int wm8739_detach(struct i2c_client *client)
|
static int wm8739_detach(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
|
struct wm8739_state *state = i2c_get_clientdata(client);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = i2c_detach_client(client);
|
err = i2c_detach_client(client);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
kfree(state);
|
||||||
kfree(client);
|
kfree(client);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,12 +222,14 @@ static int wm8775_probe(struct i2c_adapter *adapter)
|
||||||
|
|
||||||
static int wm8775_detach(struct i2c_client *client)
|
static int wm8775_detach(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
|
struct wm8775_state *state = i2c_get_clientdata(client);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = i2c_detach_client(client);
|
err = i2c_detach_client(client);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
kfree(state);
|
||||||
kfree(client);
|
kfree(client);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue