[PATCH] I2C hwmon: kfree fixes
Changes
2 files changed · +2 −2
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| drivers/hwmon/adm1026.c | modified | +1 | −1 | View file |
| drivers/hwmon/adm1031.c | modified | +1 | −1 | View file |
drivers/hwmon/adm1026.c
View filediff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index ded6e8a..c8a7f47 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter)
int adm1026_detach_client(struct i2c_client *client)
{
i2c_detach_client(client);
- kfree(client);
+ kfree(i2c_get_clientdata(client));
return 0;
}
drivers/hwmon/adm1031.c
View filediff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index 4211c8b..9362509 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client)
if ((ret = i2c_detach_client(client)) != 0) {
return ret;
}
- kfree(client);
+ kfree(i2c_get_clientdata(client));
return 0;
}