diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-07-20 05:25:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-20 16:35:57 -0400 |
commit | 1b2232ab879993fcf5b9391c3febf6ab5d78201e (patch) | |
tree | 276a20811a8b8fd2bf83c30396d587eacefff0ad /drivers | |
parent | 2fc9e2f78acd06d0a76a05abb2802cc4616453e3 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/wm8739.c | 2 | ||||
-rw-r--r-- | drivers/media/video/wm8775.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/wm8739.c b/drivers/media/video/wm8739.c index 8f6741a28a47..1bf4cbec6a87 100644 --- a/drivers/media/video/wm8739.c +++ b/drivers/media/video/wm8739.c | |||
@@ -321,12 +321,14 @@ static int wm8739_probe(struct i2c_adapter *adapter) | |||
321 | 321 | ||
322 | static int wm8739_detach(struct i2c_client *client) | 322 | static int wm8739_detach(struct i2c_client *client) |
323 | { | 323 | { |
324 | struct wm8739_state *state = i2c_get_clientdata(client); | ||
324 | int err; | 325 | int err; |
325 | 326 | ||
326 | err = i2c_detach_client(client); | 327 | err = i2c_detach_client(client); |
327 | if (err) | 328 | if (err) |
328 | return err; | 329 | return err; |
329 | 330 | ||
331 | kfree(state); | ||
330 | kfree(client); | 332 | kfree(client); |
331 | return 0; | 333 | return 0; |
332 | } | 334 | } |
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 4df5d30d4d09..9f7e894ef962 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c | |||
@@ -222,12 +222,14 @@ static int wm8775_probe(struct i2c_adapter *adapter) | |||
222 | 222 | ||
223 | static int wm8775_detach(struct i2c_client *client) | 223 | static int wm8775_detach(struct i2c_client *client) |
224 | { | 224 | { |
225 | struct wm8775_state *state = i2c_get_clientdata(client); | ||
225 | int err; | 226 | int err; |
226 | 227 | ||
227 | err = i2c_detach_client(client); | 228 | err = i2c_detach_client(client); |
228 | if (err) { | 229 | if (err) { |
229 | return err; | 230 | return err; |
230 | } | 231 | } |
232 | kfree(state); | ||
231 | kfree(client); | 233 | kfree(client); |
232 | 234 | ||
233 | return 0; | 235 | return 0; |