summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adm9240.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2005-08-26 01:49:14 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-26 16:30:30 -0700
commit1f57ff89fee47a317e9e8ca63bf0f139802cc116 (patch)
tree0db3419ab73cabed542a18cd5c7da50b03df896c /drivers/hwmon/adm9240.c
parentd634cc15e8f33332038dc9c078beae79f9382ada (diff)
downloadlinux-stable-1f57ff89fee47a317e9e8ca63bf0f139802cc116.tar.gz
linux-stable-1f57ff89fee47a317e9e8ca63bf0f139802cc116.tar.bz2
linux-stable-1f57ff89fee47a317e9e8ca63bf0f139802cc116.zip
[PATCH] drivers/hwmon/*: kfree() correct pointers
The adm9240 driver, in adm9240_detect(), allocates a structure. The error path attempts to kfree() ->client field of it (second one), resulting in an oops (or slab corruption) if the hardware is not present. ->client field in adm1026, adm1031, smsc47b397 and smsc47m1 is the first in ${HWMON}_data structure, but fix them too. Signed-off-by: Jonathan Corbet <corbet@lwn.net Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/hwmon/adm9240.c')
-rw-r--r--drivers/hwmon/adm9240.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 5c68e9c311aa..ce2a6eb93f6e 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -616,7 +616,7 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind)
return 0;
exit_free:
- kfree(new_client);
+ kfree(data);
exit:
return err;
}