From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] ACPI/APEI: Unlock apei_iomaps_lock on error path Date: Fri, 22 Mar 2013 08:20:37 +0000 Message-ID: References: <514C214C02000078000C7AAB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <514C214C02000078000C7AAB@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Andrew Cooper Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 22/03/2013 08:15, "Jan Beulich" wrote: >>>> On 22.03.13 at 00:19, Andrew Cooper wrote: >> This causes deadlocks during early boot on hardware with broken/buggy APEI >> implementations, such as a Dell Poweredge 2950 with the latest currently >> available BIOS. >> >> Signed-off-by: Andrew Cooper >> >> diff -r 7babbd46586b -r 6a952c14c4dc xen/drivers/acpi/apei/apei-io.c >> --- a/xen/drivers/acpi/apei/apei-io.c >> +++ b/xen/drivers/acpi/apei/apei-io.c >> @@ -147,12 +147,15 @@ static void __init apei_post_unmap(paddr >> spin_lock_irqsave(&apei_iomaps_lock, flags); >> map = __apei_find_iomap(paddr, size); >> if (!map) >> - return; >> + goto err; >> >> list_del(&map->list); >> spin_unlock_irqrestore(&apei_iomaps_lock, flags); >> >> xfree(map); >> + return; >> +err: >> + spin_unlock_irqrestore(&apei_iomaps_lock, flags); >> } >> >> /* In NMI handler, should set silent = 1 */ > > I'd prefer doing this slightly differently: In this case, agreed. -- Keir > --- a/xen/drivers/acpi/apei/apei-io.c > +++ b/xen/drivers/acpi/apei/apei-io.c > @@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr > > spin_lock_irqsave(&apei_iomaps_lock, flags); > map = __apei_find_iomap(paddr, size); > - if (!map) > - return; > - > - list_del(&map->list); > + if (map) > + list_del(&map->list); > spin_unlock_irqrestore(&apei_iomaps_lock, flags); > > xfree(map); > > Jan >