diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2013-03-16 06:32:16 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-20 12:58:53 -0700 |
commit | e97d818d630b09895d0f5efd879df08777273f11 (patch) | |
tree | b99f0179ccf4ba3ba562c71c180d66ef8d852cdd | |
parent | f77ce97ae2bc14cd3a340b3ce91008350fc3fa3f (diff) | |
download | kernel_samsung_tuna-e97d818d630b09895d0f5efd879df08777273f11.zip kernel_samsung_tuna-e97d818d630b09895d0f5efd879df08777273f11.tar.gz kernel_samsung_tuna-e97d818d630b09895d0f5efd879df08777273f11.tar.bz2 |
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>
-rw-r--r-- | drivers/hwmon/sht15.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index bbfa1e3..8aa6e12 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; } /* |