lkml.org 
[lkml]   [2011]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ACPI: Fix memory leak in acpi_ev_asynch_execute_gpe_method().
From
Date
On Mon, 2011-01-17 at 03:37 +0800, Jesper Juhl wrote:
> We will leak the memory allocated to 'local_gpe_event_info' if
> 'acpi_ut_acquire_mutex()' fails or if 'acpi_ev_valid_gpe_event()' fails in
> drivers/acpi/acpica/evgpe.c::acpi_ev_asynch_execute_gpe_method().
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> evgpe.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
> index 7c339d3..b6de1fb 100644
> --- a/drivers/acpi/acpica/evgpe.c
> +++ b/drivers/acpi/acpica/evgpe.c
> @@ -471,6 +471,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
>
> status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
> if (ACPI_FAILURE(status)) {
> + ACPI_FREE(local_gpe_event_info);
> return_VOID;
> }
>
> @@ -478,6 +479,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
>
> if (!acpi_ev_valid_gpe_event(gpe_event_info)) {
> status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
> + ACPI_FREE(local_gpe_event_info);
> return_VOID;
> }
>
>

Acked-by: Lin Ming <ming.m.lin@intel.com>

Thanks.




\
 
 \ /
  Last update: 2011-01-17 02:49    [W:0.136 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site