From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laura Abbott Subject: [PATCH REPOST] arm: Don't try to print pud/pmd information unless present Date: Wed, 6 Jun 2012 10:58:36 -0700 Message-ID: <1339005516-29544-1-git-send-email-lauraa@codeaurora.org> Return-path: Received: from wolverine02.qualcomm.com ([199.106.114.251]:10495 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757850Ab2FFR6r (ORCPT ); Wed, 6 Jun 2012 13:58:47 -0400 Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Russell King , Nicolas Pitre , Catalin Marinas , linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org, Laura Abbott Currently in show_pte, there are unconditional checks for pud_none/pud_bad/pmd_none/pmd_bad. If pud/pmd are not used, this may incorrectly try to interpret entries as pud/pmd entries which may print bogus information (e.g. marking a pgd as bad when the entry is valid). Only check for pud/pmd information if pud/pmd is actually used. Signed-off-by: Laura Abbott --- arch/arm/mm/fault.c | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index d7561bb..f69dee0 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -103,27 +103,29 @@ void show_pte(struct mm_struct *mm, unsigned long addr) } pud = pud_offset(pgd, addr); - if (PTRS_PER_PUD != 1) + if (PTRS_PER_PUD != 1) { printk(", *pud=%08lx", pud_val(*pud)); - if (pud_none(*pud)) - break; + if (pud_none(*pud)) + break; - if (pud_bad(*pud)) { - printk("(bad)"); - break; + if (pud_bad(*pud)) { + printk("(bad)"); + break; + } } pmd = pmd_offset(pud, addr); - if (PTRS_PER_PMD != 1) + if (PTRS_PER_PMD != 1) { printk(", *pmd=%08llx", (long long)pmd_val(*pmd)); - if (pmd_none(*pmd)) - break; + if (pmd_none(*pmd)) + break; - if (pmd_bad(*pmd)) { - printk("(bad)"); - break; + if (pmd_bad(*pmd)) { + printk("(bad)"); + break; + } } /* We must not map this if we have highmem enabled */ -- 1.7.8.3