Skip to content

Commit

Permalink
ACPI: fix potential memory leak in acpi_evaluate_integer() error path
Browse files Browse the repository at this point in the history
Signed-off-by: Vasily Averin <vvs@sw.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Vasily Averin authored and Len Brown committed May 14, 2006
1 parent 5810452 commit 64385f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ acpi_evaluate_integer(acpi_handle handle,
status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status);
kfree(element);
return_ACPI_STATUS(status);
}

if (element->type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
kfree(element);
return_ACPI_STATUS(AE_BAD_DATA);
}

Expand Down

0 comments on commit 64385f2

Please sign in to comment.