History

[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)

Mark M. Hoffman committed 21 years ago

Commit bebf4681 parent 32818c22 files · +2 −2Browse files

Unified · Split

2 files
  1. drivers/hwmon/adm1026.c +1 −1
  2. drivers/hwmon/adm1031.c +1 −1
drivers/hwmon/adm1026.c+1−1
@@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter) · 324 unmodified lines
325325 int adm1026_detach_client(struct i2c_client *client)
326326 {
327327 i2c_detach_client(client);
328− kfree(client);
328+ kfree(i2c_get_clientdata(client));
329329 return 0;
330330 }
331331
drivers/hwmon/adm1031.c+1−1
@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client) · 844 unmodified lines
845845 if ((ret = i2c_detach_client(client)) != 0) {
846846 return ret;
847847 }
848− kfree(client);
848+ kfree(i2c_get_clientdata(client));
849849 return 0;
850850 }
851851

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t