From 035a64ceb5b98623b9d7839c08087210190d4853 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 18 Mar 2013 12:41:10 -0700 Subject: [PATCH] 3.4-stable patches added patches: hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch --- ...emory-leak-if-regulator_enable-fails.patch | 36 +++++++++++++++++++ queue-3.4/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 queue-3.4/hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch diff --git a/queue-3.4/hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch b/queue-3.4/hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch new file mode 100644 index 00000000000..b16b59f6277 --- /dev/null +++ b/queue-3.4/hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch @@ -0,0 +1,36 @@ +From linux@roeck-us.net Mon Mar 18 12:40:31 2013 +From: Guenter Roeck +Date: Sat, 16 Mar 2013 06:32:16 -0700 +Subject: hwmon: (sht15) Fix memory leak if regulator_enable() fails +To: stable@vger.kernel.org +Cc: Ben Hutchings , Guenter Roeck +Message-ID: <1363440736-14964-1-git-send-email-linux@roeck-us.net> + +From: Ben Hutchings + +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 +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- +Applies to stable branches between 3.0 and 3.6 where commit 3e78080f8148 +has been applied. + + drivers/hwmon/sht15.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/hwmon/sht15.c ++++ b/drivers/hwmon/sht15.c +@@ -930,7 +930,7 @@ static int __devinit sht15_probe(struct + if (ret != 0) { + dev_err(&pdev->dev, + "failed to enable regulator: %d\n", ret); +- return ret; ++ goto err_free_data; + } + + /* diff --git a/queue-3.4/series b/queue-3.4/series index 1776c63804a..383b67025ff 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -29,3 +29,4 @@ s390-mm-fix-flush_tlb_kernel_range.patch btrfs-use-rcu_barrier-to-wait-for-bdev-puts-at-unmount.patch atmel_lcdfb-fix-16-bpp-modes-on-older-socs.patch drm-i915-ebusy-status-handling-added-to-i915_gem_fault.patch +hwmon-sht15-fix-memory-leak-if-regulator_enable-fails.patch -- 2.47.3