Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips Don't access pg before the KASSERT it's n...



details:   https://anonhg.NetBSD.org/src/rev/cb9aa03e6254
branches:  trunk
changeset: 823867:cb9aa03e6254
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri May 12 06:38:18 2017 +0000

description:
Don't access pg before the KASSERT it's not NULL

diffstat:

 sys/arch/mips/mips/pmap_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 5f094708a02d -r cb9aa03e6254 sys/arch/mips/mips/pmap_machdep.c
--- a/sys/arch/mips/mips/pmap_machdep.c Fri May 12 05:46:39 2017 +0000
+++ b/sys/arch/mips/mips/pmap_machdep.c Fri May 12 06:38:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_machdep.c,v 1.13 2017/05/07 04:14:20 skrll Exp $  */
+/*     $NetBSD: pmap_machdep.c,v 1.14 2017/05/12 06:38:18 skrll Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.13 2017/05/07 04:14:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.14 2017/05/12 06:38:18 skrll Exp $");
 
 /*
  *     Manages physical address maps.
@@ -722,9 +722,9 @@
 
        const paddr_t pa = pmap_md_direct_mapped_vaddr_to_paddr(va);
        struct vm_page * const pg = PHYS_TO_VM_PAGE(pa);
-       struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg);
 
        KASSERT(pg);
+       struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg);
 
        KASSERT(VM_PAGEMD_CACHED_P(mdpg));
        mdpg->mdpg_first.pv_va = va;



Home | Main Index | Thread Index | Old Index