Commit 969ff7dc authored by Ben Hutchings's avatar Ben Hutchings Committed by Greg Kroah-Hartman

hwmon: (sht15) Fix memory leak if regulator_enable() fails

Commit 3e78080f ('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: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 81da76ae
......@@ -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;
}
/*
......
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