[PATCH] I2C: m41t00: fix incorrect kfree
authorJean Delvare <khali@linux-fr.org>
Fri, 1 Jul 2005 12:28:15 +0000 (14:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 11 Jul 2005 21:10:36 +0000 (14:10 -0700)
Here is a simple path fixing an incorrect kfree in the m41t00 i2c chip
driver. The current code happens to work by accident, but the freed
pointer isn't the one which was allocated in the first place, which
could cause problems later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/chips/m41t00.c

index 5e463c47bfbc70e66e8d23ab73a71aab193b31ee..778d7e12859dd0de54ed2b877c6d0ffcee72dfee 100644 (file)
@@ -207,7 +207,7 @@ m41t00_detach(struct i2c_client *client)
        int     rc;
 
        if ((rc = i2c_detach_client(client)) == 0) {
-               kfree(i2c_get_clientdata(client));
+               kfree(client);
                tasklet_kill(&m41t00_tasklet);
        }
        return rc;