From: Jean Delvare Date: Fri, 1 Jul 2005 12:28:15 +0000 (+0200) Subject: [PATCH] I2C: m41t00: fix incorrect kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5da69ba42aa42a479c0f5d8cb8351ebb6b51c12e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] I2C: m41t00: fix incorrect kfree 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index 5e463c47bfbc..778d7e12859d 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c @@ -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;