From patchwork Tue Aug 17 23:46:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Dongming X-Patchwork-Id: 120048 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7HNkoAo011339 for ; Tue, 17 Aug 2010 23:46:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241Ab0HQXqt (ORCPT ); Tue, 17 Aug 2010 19:46:49 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:54234 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179Ab0HQXqt (ORCPT ); Tue, 17 Aug 2010 19:46:49 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o7HNklY8006657 (envelope-from jin.dongming@np.css.fujitsu.com); Wed, 18 Aug 2010 08:46:47 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 2EF0B45DE57; Wed, 18 Aug 2010 08:46:47 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 0DD9745DE51; Wed, 18 Aug 2010 08:46:47 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id EA4F71DB803A; Wed, 18 Aug 2010 08:46:46 +0900 (JST) Received: from m005.s.css.fujitsu.com (m005.s.css.fujitsu.com [10.23.4.35]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 9F4FA1DB803C; Wed, 18 Aug 2010 08:46:46 +0900 (JST) Received: from m005.css.fujitsu.com (m005 [127.0.0.1]) by m005.s.css.fujitsu.com (Postfix) with ESMTP id 7DCC12DFDF6; Wed, 18 Aug 2010 08:46:46 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.102.46]) by m005.s.css.fujitsu.com (Postfix) with ESMTP id 31D1E2DFDE6; Wed, 18 Aug 2010 08:46:46 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.5.1 Message-ID: <4C6B1F63.9050703@np.css.fujitsu.com> Date: Wed, 18 Aug 2010 08:46:43 +0900 From: Jin Dongming User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: Huang Ying CC: Randy Dunlap , Stephen Rothwell , Andi Kleen , Hidetoshi Seto , LKLM , ACPI Subject: [PATCH 1/2] [Patch-next -v2] ACPI, APEI Fix the return value(==NULL) of acpi_pre_map(). Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 17 Aug 2010 23:46:51 +0000 (UTC) diff --git a/drivers/acpi/atomicio.c b/drivers/acpi/atomicio.c index 8f8bd73..1bc2614 100644 --- a/drivers/acpi/atomicio.c +++ b/drivers/acpi/atomicio.c @@ -133,7 +133,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr, spin_lock_irqsave(&acpi_iomaps_lock, flags); vaddr = __acpi_try_ioremap(paddr, size); - if (vaddr) { + if (unlikely(vaddr)) { spin_unlock_irqrestore(&acpi_iomaps_lock, flags); iounmap(map->vaddr); kfree(map); @@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr, list_add_tail_rcu(&map->list, &acpi_iomaps); spin_unlock_irqrestore(&acpi_iomaps_lock, flags); - return vaddr + (paddr - pg_off); + return map->vaddr + (paddr - pg_off); err_unmap: iounmap(vaddr); return NULL;