hwmon: (sht15) Fix memory leak if regulator_enable() fails
authorBen Hutchings <ben@decadent.org.uk>
Sat, 16 Mar 2013 13:32:16 +0000 (06:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2013 20:05:00 +0000 (13:05 -0700)
commit969ff7dc5423e50938e7b42b59fe1163aced714c
treece4ad064d2103322f8b11964f1e089909982a5fc
parent81da76ae314c66e32b8c06b0ce155a5b61670dd7
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>
drivers/hwmon/sht15.c