RE: [patch 11/16] acpi: memory leak in acpi_evaluate_integer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



applied.

thanks,
-Len 

>-----Original Message-----
>From: akpm@xxxxxxxx [mailto:akpm@xxxxxxxx] 
>Sent: Thursday, April 27, 2006 5:25 AM
>To: Brown, Len
>Cc: linux-acpi@xxxxxxxxxxxxxxx; akpm@xxxxxxxx; vvs@xxxxx
>Subject: [patch 11/16] acpi: memory leak in acpi_evaluate_integer()
>
>
>From: Vasily Averin <vvs@xxxxx>
>
>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 <vvs@xxxxx>
>Cc: "Brown, Len" <len.brown@xxxxxxxxx>
>Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
>---
>
> 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);
> 	}
> 
>_
>
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux