From owner-svn-src-vendor@FreeBSD.ORG Wed Jun 27 16:07:59 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 704311065673; Wed, 27 Jun 2012 16:07:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4250A8FC14; Wed, 27 Jun 2012 16:07:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RG7xl5019521; Wed, 27 Jun 2012 16:07:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5RG7xlN019519; Wed, 27 Jun 2012 16:07:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201206271607.q5RG7xlN019519@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 27 Jun 2012 16:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237650 - vendor-sys/acpica/dist/source/components/events X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 16:07:59 -0000 Author: jkim Date: Wed Jun 27 16:07:58 2012 New Revision: 237650 URL: http://svn.freebsd.org/changeset/base/237650 Log: Do not malloc(9) while holding a spin lock, to avoid panic. Note it was submitted upstream and it should be fixed in the next ACPICA release. Discussed with: Moore, Robert (robert dot moore at intel dot com) Modified: vendor-sys/acpica/dist/source/components/events/evxfgpe.c Modified: vendor-sys/acpica/dist/source/components/events/evxfgpe.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jun 27 16:07:01 2012 (r237649) +++ vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jun 27 16:07:58 2012 (r237650) @@ -298,7 +298,7 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; ACPI_CPU_FLAGS Flags; @@ -334,6 +334,12 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); + if (!NewNotify) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); /* Ensure that we have a valid GPE number */ @@ -384,16 +390,10 @@ AcpiSetupGpeForWake ( /* Add this device to the notify list for this GPE */ - Notify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); - if (!Notify) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - Notify->DeviceNode = DeviceNode; - Notify->Next = GpeEventInfo->Dispatch.NotifyList; - GpeEventInfo->Dispatch.NotifyList = Notify; + NewNotify->DeviceNode = DeviceNode; + NewNotify->Next = GpeEventInfo->Dispatch.NotifyList; + GpeEventInfo->Dispatch.NotifyList = NewNotify; + NewNotify = NULL; } /* Mark the GPE as a possible wake event */ @@ -403,6 +403,10 @@ AcpiSetupGpeForWake ( UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + if (NewNotify) + { + ACPI_FREE (NewNotify); + } return_ACPI_STATUS (Status); }