提交 bebf4688 编写于 作者: M Mark M. Hoffman 提交者: Linus Torvalds

[PATCH] I2C hwmon: kfree fixes

This patch fixes several instances of hwmon drivers kfree'ing the "wrong"
pointer; the existing code works somewhat by accident.

(akpm: plucked from Greg's queue based on lkml discussion.  Finishes off the
patch from Jon Corbet)
Signed-off-by: NMark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 32818c2e
...@@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter) ...@@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter)
int adm1026_detach_client(struct i2c_client *client) int adm1026_detach_client(struct i2c_client *client)
{ {
i2c_detach_client(client); i2c_detach_client(client);
kfree(client); kfree(i2c_get_clientdata(client));
return 0; return 0;
} }
......
...@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client) ...@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client)
if ((ret = i2c_detach_client(client)) != 0) { if ((ret = i2c_detach_client(client)) != 0) {
return ret; return ret;
} }
kfree(client); kfree(i2c_get_clientdata(client));
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册