From 1f57ff89fee47a317e9e8ca63bf0f139802cc116 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 26 Aug 2005 01:49:14 +0400 Subject: [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 Signed-off-by: Linus Torvalds --- drivers/hwmon/adm1026.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/hwmon/adm1026.c') diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 4fa17c76eea..ded6e8adc85 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -1691,7 +1691,7 @@ int adm1026_detect(struct i2c_adapter *adapter, int address, /* Error out and cleanup code */ exitfree: - kfree(new_client); + kfree(data); exit: return err; } -- cgit v1.2.3