Skip to content

Commit

Permalink
drivers/platform/x86: Fix memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andre Bartke authored and Matthew Garrett committed Jul 7, 2011
1 parent 2d43f67 commit 96b269c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/platform/x86/compal-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev)
initialize_fan_control_data(data);

err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group);
if (err)
if (err) {
kfree(data);
return err;
}

data->hwmon_dev = hwmon_device_register(&pdev->dev);
if (IS_ERR(data->hwmon_dev)) {
Expand Down

0 comments on commit 96b269c

Please sign in to comment.