Commit 1434394a authored by Roel Kluin's avatar Roel Kluin Committed by James Toy

If already requested, gpio_data and irq should be freed in the case of an

error.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent e174ae90
...@@ -562,7 +562,7 @@ static int __devinit sht15_probe(struct platform_device *pdev) ...@@ -562,7 +562,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
ret = sysfs_create_group(&pdev->dev.kobj, &sht15_attr_group); ret = sysfs_create_group(&pdev->dev.kobj, &sht15_attr_group);
if (ret) { if (ret) {
dev_err(&pdev->dev, "sysfs create failed"); dev_err(&pdev->dev, "sysfs create failed");
goto err_free_data; goto err_release_gpio_data;
} }
ret = request_irq(gpio_to_irq(data->pdata->gpio_data), ret = request_irq(gpio_to_irq(data->pdata->gpio_data),
...@@ -581,10 +581,12 @@ static int __devinit sht15_probe(struct platform_device *pdev) ...@@ -581,10 +581,12 @@ static int __devinit sht15_probe(struct platform_device *pdev)
data->hwmon_dev = hwmon_device_register(data->dev); data->hwmon_dev = hwmon_device_register(data->dev);
if (IS_ERR(data->hwmon_dev)) { if (IS_ERR(data->hwmon_dev)) {
ret = PTR_ERR(data->hwmon_dev); ret = PTR_ERR(data->hwmon_dev);
goto err_release_gpio_data; goto err_release_irq;
} }
return 0; return 0;
err_release_irq:
free_irq(gpio_to_irq(data->pdata->gpio_data), data);
err_release_gpio_data: err_release_gpio_data:
gpio_free(data->pdata->gpio_data); gpio_free(data->pdata->gpio_data);
err_release_gpio_sck: err_release_gpio_sck:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment