From: Vasily Averin acpi_evaluate_integer() does not release allocated memory on the error path. (akpm: this is what happens when one uses multiple `return' statements...) Signed-off-by: Vasily Averin Cc: "Brown, Len" Signed-off-by: Andrew Morton --- drivers/acpi/utils.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN drivers/acpi/utils.c~memory-leak-in-acpi_evaluate_integer drivers/acpi/utils.c --- devel/drivers/acpi/utils.c~memory-leak-in-acpi_evaluate_integer 2006-04-10 23:16:23.000000000 -0700 +++ devel-akpm/drivers/acpi/utils.c 2006-04-10 23:16:23.000000000 -0700 @@ -274,11 +274,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); } _