ACPICA: Fix memory leak in acpi_ev_asynch_execute_gpe_method().
authorJesper Juhl <jj@chaosbits.net>
Sun, 16 Jan 2011 19:37:52 +0000 (20:37 +0100)
committerLen Brown <len.brown@intel.com>
Wed, 19 Jan 2011 04:47:30 +0000 (23:47 -0500)
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>
Reviewed-by: Rafael Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/evgpe.c

index 7c339d34ab422dffe32028cb284513910390ddf3..b6de1fb34f4431b448ee2a8ac67de389682eb58c 100644 (file)
@@ -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;
        }