[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: 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>
This commit is contained in:
Mark M. Hoffman 2005-08-26 18:34:08 -07:00 коммит произвёл Linus Torvalds
Родитель 32818c2eb6
Коммит bebf4688e9
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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;
}