Skip to content

Commit

Permalink
[PATCH] I2C hwmon: kfree fixes
Browse files Browse the repository at this point in the history
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: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Mark M. Hoffman authored and Linus Torvalds committed Aug 27, 2005
1 parent 32818c2 commit bebf468
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/adm1031.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bebf468

Please sign in to comment.