linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laura Abbott <lauraa@codeaurora.org>
To: rmk@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org, Laura Abbott <lauraa@codeaurora.org>
Subject: [PATCH] arm: Don't try to print pud/pmd information unless present
Date: Mon, 14 May 2012 13:26:13 -0700	[thread overview]
Message-ID: <1337027173-22620-1-git-send-email-lauraa@codeaurora.org> (raw)

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 <lauraa@codeaurora.org>
---
 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

                 reply	other threads:[~2012-05-14 20:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337027173-22620-1-git-send-email-lauraa@codeaurora.org \
    --to=lauraa@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).