aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorAndre Bartke <andre.bartke@googlemail.com>2011-06-03 14:55:43 -0400
committerMatthew Garrett <mjg@redhat.com>2011-07-07 10:39:03 -0400
commit96b269c1b0e5a218096aa6ff240d2286e99ddd6d (patch)
treed0ee03be5869fbf968d2fce139238b922ccff4a3 /drivers/platform
parent2d43f671c8fb0fd72e896a8b31e15b98916f707d (diff)
drivers/platform/x86: Fix memory leak
data is not freed in the error case of compal_probe(). Signed-off-by: Andre Bartke <andre.bartke@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/compal-laptop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 3f204fde1b02..8877b836d27c 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev)
1030 initialize_fan_control_data(data); 1030 initialize_fan_control_data(data);
1031 1031
1032 err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group); 1032 err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group);
1033 if (err) 1033 if (err) {
1034 kfree(data);
1034 return err; 1035 return err;
1036 }
1035 1037
1036 data->hwmon_dev = hwmon_device_register(&pdev->dev); 1038 data->hwmon_dev = hwmon_device_register(&pdev->dev);
1037 if (IS_ERR(data->hwmon_dev)) { 1039 if (IS_ERR(data->hwmon_dev)) {