diff options
Diffstat (limited to 'source/components/events/evxfgpe.c')
-rw-r--r-- | source/components/events/evxfgpe.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c index 750c460..4194651 100644 --- a/source/components/events/evxfgpe.c +++ b/source/components/events/evxfgpe.c @@ -83,7 +83,7 @@ AcpiUpdateAllGpes ( ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (AcpiUpdateGpes); + ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes); Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); @@ -298,7 +298,8 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify; ACPI_CPU_FLAGS Flags; @@ -334,6 +335,11 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* + * Allocate a new notify object up front, in case it is needed. + * Memory allocation while holding a spinlock is a big no-no + * on some hosts. + */ NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); if (!NewNotify) { @@ -401,8 +407,12 @@ AcpiSetupGpeForWake ( GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; Status = AE_OK; + UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + + /* Delete the notify object if it was not used above */ + if (NewNotify) { ACPI_FREE (NewNotify); |