summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-03-16 06:32:16 -0700
committerXavier Boudet <x-boudet@ti.com>2013-03-21 13:29:34 +0100
commite80d834e0f7f8019a5d1cabe975bce9e8e9b8d88 (patch)
tree8d6b51d41b7e983372e53be36aac675951da08c2 /drivers/hwmon
parent94b4e37c89165bc5cf894653ed224b70ade83ee5 (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/hwmon')
-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 eb0180221d04..c68963023cab 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;
}
/*