From patchwork Thu Jun 17 01:31:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 106589 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5H1WFJL012174 for ; Thu, 17 Jun 2010 01:32:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758981Ab0FQBbz (ORCPT ); Wed, 16 Jun 2010 21:31:55 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:33405 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755648Ab0FQBby (ORCPT ); Wed, 16 Jun 2010 21:31:54 -0400 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o5H1Vr5D021133 (envelope-from kaneshige.kenji@jp.fujitsu.com); Thu, 17 Jun 2010 10:31:53 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id CE61D45DE4F; Thu, 17 Jun 2010 10:31:52 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id AA86E45DE51; Thu, 17 Jun 2010 10:31:52 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 934DB1DB805A; Thu, 17 Jun 2010 10:31:52 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 514EB1DB8040; Thu, 17 Jun 2010 10:31:49 +0900 (JST) Received: from m106.css.fujitsu.com (m106 [127.0.0.1]) by m106.s.css.fujitsu.com (Postfix) with ESMTP id 2372A5B8D44; Thu, 17 Jun 2010 10:31:49 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m106.s.css.fujitsu.com (Postfix) with ESMTP id 928FA5B8C99; Thu, 17 Jun 2010 10:31:48 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Thu, 17 Jun 2010 10:31:20 +0900 (JST) Message-ID: <4C197ADF.90509@jp.fujitsu.com> Date: Thu, 17 Jun 2010 10:31:11 +0900 From: Kenji Kaneshige User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org CC: linux-pci@vger.kernel.org, macro@linux-mips.org, kamezawa.hiroyu@jp.fujitsu.com, eike-kernel@sf-tec.de Subject: [PATCH 2/2] x86: ioremap: fix normal ram range check References: <4C197A49.6020400@jp.fujitsu.com> In-Reply-To: <4C197A49.6020400@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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]); Thu, 17 Jun 2010 01:32:16 +0000 (UTC) Index: linux-2.6.34/arch/x86/mm/ioremap.c =================================================================== --- linux-2.6.34.orig/arch/x86/mm/ioremap.c 2010-06-15 05:33:06.272381451 +0900 +++ linux-2.6.34/arch/x86/mm/ioremap.c 2010-06-15 05:33:21.086585690 +0900 @@ -101,7 +101,7 @@ * Don't allow anybody to remap normal RAM that we're using.. */ last_pfn = last_addr >> PAGE_SHIFT; - for (pfn = phys_addr >> PAGE_SHIFT; pfn < last_pfn; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) { int is_ram = page_is_ram(pfn); if (is_ram && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn)))