diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2005-08-25 17:49:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-26 19:30:30 -0400 |
commit | 1f57ff89fee47a317e9e8ca63bf0f139802cc116 (patch) | |
tree | 0db3419ab73cabed542a18cd5c7da50b03df896c /drivers/hwmon/adm1026.c | |
parent | d634cc15e8f33332038dc9c078beae79f9382ada (diff) |
[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/adm1026.c')
-rw-r--r-- | drivers/hwmon/adm1026.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 4fa17c76eea2..ded6e8adc854 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -1691,7 +1691,7 @@ int adm1026_detect(struct i2c_adapter *adapter, int address, | |||
1691 | 1691 | ||
1692 | /* Error out and cleanup code */ | 1692 | /* Error out and cleanup code */ |
1693 | exitfree: | 1693 | exitfree: |
1694 | kfree(new_client); | 1694 | kfree(data); |
1695 | exit: | 1695 | exit: |
1696 | return err; | 1696 | return err; |
1697 | } | 1697 | } |