stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ACPI / resources: free memory on error in add_region_before()" has been added to the 4.1-stable tree
@ 2015-07-31  0:42 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-07-31  0:42 UTC (permalink / raw)
  To: dan.carpenter, gregkh, rafael.j.wysocki; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ACPI / resources: free memory on error in add_region_before()

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-resources-free-memory-on-error-in-add_region_before.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 7bc10388ccdd79b3d20463151a1f8e7a590a775b Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 24 Jun 2015 17:30:15 +0300
Subject: ACPI / resources: free memory on error in add_region_before()

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 7bc10388ccdd79b3d20463151a1f8e7a590a775b upstream.

There is a small memory leak on error.

Fixes: 0f1b414d1907 (ACPI / PNP: Avoid conflicting resource reservations)
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/resource.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -660,8 +660,10 @@ static int add_region_before(u64 start,
 		return -ENOMEM;
 
 	error = request_range(start, end, space_id, flags, desc);
-	if (error)
+	if (error) {
+		kfree(reg);
 		return error;
+	}
 
 	reg->start = start;
 	reg->end = end;


Patches currently in stable-queue which might be from dan.carpenter@oracle.com are

queue-4.1/acpi-lpss-fix-up-acpi_lpss_create_device.patch
queue-4.1/ima-cleanup-ima_init_policy-a-little.patch
queue-4.1/usb-devio-fix-a-condition-in-async_completed.patch
queue-4.1/acpi-resources-free-memory-on-error-in-add_region_before.patch
queue-4.1/asoc-imx-wm8962-add-a-missing-error-check.patch
queue-4.1/ath9k_htc-memory-corruption-calling-set_bit.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-31  0:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31  0:42 Patch "ACPI / resources: free memory on error in add_region_before()" has been added to the 4.1-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).