提交 96b269c1 编写于 作者: A Andre Bartke 提交者: Matthew Garrett

drivers/platform/x86: Fix memory leak

data is not freed in the error case of
compal_probe().
Signed-off-by: NAndre Bartke <andre.bartke@gmail.com>
Signed-off-by: NMatthew Garrett <mjg@redhat.com>
上级 2d43f671
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册