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
325int adm1026_detach_client(struct i2c_client *client)325int adm1026_detach_client(struct i2c_client *client)
326{326{
327 i2c_detach_client(client);327 i2c_detach_client(client);
328 kfree(client);328 kfree(i2c_get_clientdata(client));
329 return 0;329 return 0;
330}330}
331 331
drivers/hwmon/adm1031.c+1−1
@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client) · 844 unmodified lines
845 if ((ret = i2c_detach_client(client)) != 0) {845 if ((ret = i2c_detach_client(client)) != 0) {
846 return ret;846 return ret;
847 }847 }
848 kfree(client);848 kfree(i2c_get_clientdata(client));
849 return 0;849 return 0;
850}850}
851 851

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