]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (5880): wm8775/wm8739: Fix memory leak when unloading module
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 20 Jul 2007 09:25:22 +0000 (06:25 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 20 Jul 2007 20:35:57 +0000 (17:35 -0300)
State struct was never freed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/wm8739.c
drivers/media/video/wm8775.c

index 8f6741a28a4768455628733013fd41f51cd02895..1bf4cbec6a87a7a738a7334db4dbfd4104d6ac8b 100644 (file)
@@ -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;
 }
index 4df5d30d4d09bf7a00a3a795d0a0880e6e511933..9f7e894ef962cdc4d76baec111aacb99fa700261 100644 (file)
@@ -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;