]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/acpica-utilities-fix-memory-leak-in-acpi_ut_copy_iobject_to_iobject.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / acpica-utilities-fix-memory-leak-in-acpi_ut_copy_iobject_to_iobject.patch
1 From 8aa5e56eeb61a099ea6519eb30ee399e1bc043ce Mon Sep 17 00:00:00 2001
2 From: "David E. Box" <david.e.box@linux.intel.com>
3 Date: Tue, 8 Jul 2014 10:05:52 +0800
4 Subject: ACPICA: Utilities: Fix memory leak in acpi_ut_copy_iobject_to_iobject
5
6 From: "David E. Box" <david.e.box@linux.intel.com>
7
8 commit 8aa5e56eeb61a099ea6519eb30ee399e1bc043ce upstream.
9
10 Adds return status check on copy routines to delete the allocated destination
11 object if either copy fails. Reported by Colin Ian King on bugs.acpica.org,
12 Bug 1087.
13 The last applicable commit:
14 Commit: 3371c19c294a4cb3649aa4e84606be8a1d999e61
15 Subject: ACPICA: Remove ACPI_GET_OBJECT_TYPE macro
16
17 Link: https://bugs.acpica.org/show_bug.cgi?id=1087
18 Reported-by: Colin Ian King <colin.king@canonical.com>
19 Signed-off-by: David E. Box <david.e.box@linux.intel.com>
20 Signed-off-by: Bob Moore <robert.moore@intel.com>
21 Signed-off-by: Lv Zheng <lv.zheng@intel.com>
22 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 drivers/acpi/acpica/utcopy.c | 6 ++++++
27 1 file changed, 6 insertions(+)
28
29 --- a/drivers/acpi/acpica/utcopy.c
30 +++ b/drivers/acpi/acpica/utcopy.c
31 @@ -1001,5 +1001,11 @@ acpi_ut_copy_iobject_to_iobject(union ac
32 status = acpi_ut_copy_simple_object(source_desc, *dest_desc);
33 }
34
35 + /* Delete the allocated object if copy failed */
36 +
37 + if (ACPI_FAILURE(status)) {
38 + acpi_ut_remove_reference(*dest_desc);
39 + }
40 +
41 return_ACPI_STATUS(status);
42 }