Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/vax Check that each region is inuse before free...



details:   https://anonhg.NetBSD.org/src/rev/98ab64b95c5c
branches:  trunk
changeset: 524914:98ab64b95c5c
user:      ragge <ragge%NetBSD.org@localhost>
date:      Tue Apr 02 09:47:34 2002 +0000

description:
Check that each region is inuse before freeing their related extent.
This fixes (hopefully) PR#16164.

diffstat:

 sys/arch/vax/vax/pmap.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (26 lines):

diff -r 7b84d6c12725 -r 98ab64b95c5c sys/arch/vax/vax/pmap.c
--- a/sys/arch/vax/vax/pmap.c   Tue Apr 02 07:28:23 2002 +0000
+++ b/sys/arch/vax/vax/pmap.c   Tue Apr 02 09:47:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.111 2002/03/21 22:08:08 ragge Exp $    */
+/*     $NetBSD: pmap.c,v 1.112 2002/04/02 09:47:34 ragge Exp $    */
 /*
  * Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -587,10 +587,12 @@
                }
        }
 
-       extent_free(ptemap, (u_long)pm->pm_p0br,
-           pm->pm_p0lr * PPTESZ, EX_WAITOK);
-       extent_free(ptemap, (u_long)pm->pm_p1ap,
-           (NPTEPERREG - pm->pm_p1lr) * PPTESZ, EX_WAITOK);
+       if (pm->pm_p0lr != 0)
+               extent_free(ptemap, (u_long)pm->pm_p0br,
+                   pm->pm_p0lr * PPTESZ, EX_WAITOK);
+       if (pm->pm_p1lr != NPTEPERREG)
+               extent_free(ptemap, (u_long)pm->pm_p1ap,
+                   (NPTEPERREG - pm->pm_p1lr) * PPTESZ, EX_WAITOK);
        pm->pm_p0br = pm->pm_p1br = (struct pte *)KERNBASE;
        pm->pm_p0lr = 0;
        pm->pm_p1lr = NPTEPERREG;



Home | Main Index | Thread Index | Old Index