Skip to contentSkip to conversation

memory leak in acpi_evaluate_integer()

PATCH New Vasily Averin 1 participant 1 message Apr 9, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory leak in acpi_evaluate_integer()

acpi_evaluate_integer() does not release allocated memory on the error path.

Thank you,
Vasily Averin

SWsoft Virtuozzo/OpenVZ Linux kernel team

drivers/acpi/utils.c +2 -0
@@ -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);
 	}