From: Hans Verkuil Date: Tue, 24 Jul 2007 12:07:43 +0000 (-0400) Subject: V4L: wm8775/wm8739: Fix memory leak when unloading module X-Git-Tag: v2.6.22.2~54 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69461034216f4966525a269b2dfc1d64718df10e;p=karo-tx-linux.git V4L: wm8775/wm8739: Fix memory leak when unloading module State struct was never freed. (cherry picked from commit 1b2232ab879993fcf5b9391c3febf6ab5d78201e) Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Michael Krufky Signed-off-by: Greg Kroah-Hartman --- 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) 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; } 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) 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;