summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2010-09-13 14:14:43 +0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-09-24 22:44:19 +0400
commitd172132f358552eabd7a7410e478ffeead445243 (patch)
tree89a88cc03fd1b60d047820900268b5187a77bb33 /drivers
parentd9bca4358286584cc22f4261ee3a60cad01aa4d4 (diff)
downloadlinux-d172132f358552eabd7a7410e478ffeead445243.tar.xz
x86/hwmon: don't leak device attribute file from pkgtemp_probe() and pkgtemp_remove()
While apparently inherited from coretemp source, this particular error handling cleanup and exit path wasn't copied properly (or perhaps got discarded intermediately and not re-added properly later). Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> (added device file removal in pkgtemp_remove)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/pkgtemp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
index 844957333fe5..f7ddee5fe9d5 100644
--- a/drivers/hwmon/pkgtemp.c
+++ b/drivers/hwmon/pkgtemp.c
@@ -224,7 +224,7 @@ static int __devinit pkgtemp_probe(struct platform_device *pdev)
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(struct platform_device *pdev)
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:
@@ -250,6 +252,7 @@ static int __devexit pkgtemp_remove(struct platform_device *pdev)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);
+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);
platform_set_drvdata(pdev, NULL);
kfree(data);
return 0;