lkml.org 
[lkml]   [2006]   [Apr]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 09 Apr 2006 19:07:51 +0400
FromVasily Averin <>
Subject[PATCH ACPI] memory leak in acpi_evaluate_integer()
acpi_evaluate_integer() does not release allocated memory on the error path.

Signed-off-by: Vasily Averin <vvs@sw.ru>

Thank you,
	Vasily Averin

SWsoft Virtuozzo/OpenVZ Linux kernel team
--- a/drivers/acpi/utils.c	2006-04-09 14:31:39.000000000 +0400
+++ b/drivers/acpi/utils.c	2006-04-09 14:35:02.000000000 +0400
@@ -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);
 	}
 
\
 
 \ /
  Last update: 2006-04-09 15:07    [from the cache]
©2003-2008