Skip to content

Commit

Permalink
ACPICA: Utilities: Fix memory leak in acpi_ut_copy_iobject_to_iobject
Browse files Browse the repository at this point in the history
commit 8aa5e56eeb61a099ea6519eb30ee399e1bc043ce upstream.

Adds return status check on copy routines to delete the allocated destination
object if either copy fails. Reported by Colin Ian King on bugs.acpica.org,
Bug 1087.
The last applicable commit:
 Commit: 3371c19
 Subject: ACPICA: Remove ACPI_GET_OBJECT_TYPE macro

Link: https://bugs.acpica.org/show_bug.cgi?id=1087
Reported-by: Colin Ian King <[email protected]>
Signed-off-by: David E. Box <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Lv Zheng <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
debox1 authored and gregkh committed Sep 17, 2014
1 parent eea7ccd commit e29a154
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/acpi/acpica/utcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,5 +1001,11 @@ acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc,
status = acpi_ut_copy_simple_object(source_desc, *dest_desc);
}

/* Delete the allocated object if copy failed */

if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference(*dest_desc);
}

return_ACPI_STATUS(status);
}

0 comments on commit e29a154

Please sign in to comment.