Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2012 17:50:11 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237566 - head/sys/mips/mips
Message-ID:  <201206251750.q5PHoBIi086903@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Mon Jun 25 17:50:11 2012
New Revision: 237566
URL: http://svn.freebsd.org/changeset/base/237566

Log:
  Handle case when result of pmap_pte is NULL. This issue was uncovered
      by r237367

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Mon Jun 25 17:15:09 2012	(r237565)
+++ head/sys/mips/mips/pmap.c	Mon Jun 25 17:50:11 2012	(r237566)
@@ -765,6 +765,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va
 vm_page_t
 pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
 {
+	pt_entry_t *ptep;
 	pt_entry_t pte;
 	vm_page_t m;
 	vm_paddr_t pa;
@@ -773,8 +774,9 @@ pmap_extract_and_hold(pmap_t pmap, vm_of
 	pa = 0;
 	PMAP_LOCK(pmap);
 retry:
-	pte = *pmap_pte(pmap, va);
-	if (pte != 0 && pte_test(&pte, PTE_V) &&
+	ptep = pmap_pte(pmap, va);
+	if ((ptep != NULL)  && ((pte = *ptep) != 0) && 
+	    pte_test(&pte, PTE_V) &&
 	    (pte_test(&pte, PTE_D) || (prot & VM_PROT_WRITE) == 0)) {
 		if (vm_page_pa_tryrelock(pmap, TLBLO_PTE_TO_PA(pte), &pa))
 			goto retry;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206251750.q5PHoBIi086903>