[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e8111323028522a9072a6039f21da68e989739f7.1491838390.git.jslaby@suse.cz>
Date: Mon, 10 Apr 2017 17:33:31 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...cle.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 130/142] ACPI / resources: free memory on error in add_region_before()
From: Dan Carpenter <dan.carpenter@...cle.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
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@...cle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
drivers/acpi/resource.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 28314ba82320..3760e9635aea 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -577,8 +577,10 @@ static int add_region_before(u64 start, u64 end, u8 space_id,
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;
--
2.12.2
Powered by blists - more mailing lists