[PATCH] x86/hwmon: don't leak device attribute file from pkgtemp_probe()

From: Jan Beulich
Date: Mon Sep 13 2010 - 06:14:51 EST


While apparently inherited from coretemp source, this particular error
handling cleanup path wasn't copied properly (or perhaps got discarded
intermediately and not re-added properly later).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>

---
drivers/hwmon/pkgtemp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.36-rc4/drivers/hwmon/pkgtemp.c 2010-09-13 08:45:03.000000000 +0200
+++ 2.6.36-rc4-x86-pkgtemp-probe-error-path/drivers/hwmon/pkgtemp.c 2010-09-03 17:54:30.000000000 +0200
@@ -224,7 +224,7 @@ static int __devinit pkgtemp_probe(struc

err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group);
if (err)
- goto exit_free;
+ goto exit_dev;

data->hwmon_dev = hwmon_device_register(&pdev->dev);
if (IS_ERR(data->hwmon_dev)) {
@@ -238,6 +238,8 @@ static int __devinit pkgtemp_probe(struc

exit_class:
sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);
+exit_dev:
+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);
exit_free:
kfree(data);
exit:



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/