Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Fix NULL dereference; "pap" argument...



details:   https://anonhg.NetBSD.org/src/rev/1dd2c33a9bed
branches:  trunk
changeset: 744979:1dd2c33a9bed
user:      rin <rin%NetBSD.org@localhost>
date:      Thu Feb 20 05:13:16 2020 +0000

description:
Fix NULL dereference; "pap" argument of pmap_extract(9) can be NULL.

diffstat:

 sys/arch/powerpc/ibm4xx/pmap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e3afef40cda2 -r 1dd2c33a9bed sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Thu Feb 20 05:10:01 2020 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Thu Feb 20 05:13:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.76 2016/12/24 19:02:16 cherry Exp $ */
+/*     $NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.76 2016/12/24 19:02:16 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2020/02/20 05:13:16 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -1021,7 +1021,7 @@
        int s;
 
        s = splvm();
-       if (pm->pm_ptbl[seg] && (pa = pm->pm_ptbl[seg][ptn])) {
+       if (pm->pm_ptbl[seg] && (pa = pm->pm_ptbl[seg][ptn]) && pap) {
                *pap = TTE_PA(pa) | (va & PGOFSET);
        }
        splx(s);



Home | Main Index | Thread Index | Old Index