summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-03-16 06:32:16 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-20 12:58:53 -0700
commite97d818d630b09895d0f5efd879df08777273f11 (patch)
treeb99f0179ccf4ba3ba562c71c180d66ef8d852cdd /drivers
parentf77ce97ae2bc14cd3a340b3ce91008350fc3fa3f (diff)
hwmon: (sht15) Fix memory leak if regulator_enable() fails
Commit 3e78080f8148 ('hwmon: (sht15) Check return value of regulator_enable()') depends on the use of devm_kmalloc() for automatic resource cleanup in the failure cases, which was introduced in 3.7. In older stable branches, explicit cleanup is needed. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/sht15.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index bbfa1e3a9f9c..8aa6e1215cf9 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -930,7 +930,7 @@ static int __devinit sht15_probe(struct platform_device *pdev)
if (ret != 0) {
dev_err(&pdev->dev,
"failed to enable regulator: %d\n", ret);
- return ret;
+ goto err_free_data;
}
/*