summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_amap.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-05-09 14:14:19 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-05-09 14:14:19 +0000
commitd643f42a862940f1162dd0fefaedaa717aec662e (patch)
treec827e0ae1918f44728fe7c29a484e594a1ce7f78 /sys/uvm/uvm_amap.c
parent8c98091f2ad4dae8c89198d65112941ae3bec400 (diff)
from netbsd; okay art@
revision 1.43 date: 2002/03/28 06:06:29; author: nathanw; state: Exp; lines: +13 -3 In amap_pp_adjref(), avoid incorrectly merging the first two chunks in a ppref array when the range being adjusted includes the beginning of the array.
Diffstat (limited to 'sys/uvm/uvm_amap.c')
-rw-r--r--sys/uvm/uvm_amap.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c
index 9917dcabb74..967d984823e 100644
--- a/sys/uvm/uvm_amap.c
+++ b/sys/uvm/uvm_amap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_amap.c,v 1.26 2002/03/14 01:27:18 millert Exp $ */
+/* $OpenBSD: uvm_amap.c,v 1.27 2002/05/09 14:14:18 provos Exp $ */
/* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -954,7 +954,17 @@ amap_pp_adjref(amap, curslot, slotlen, adjval)
}
prevlcv = lcv;
}
- pp_getreflen(ppref, prevlcv, &prevref, &prevlen);
+ if (lcv != 0)
+ pp_getreflen(ppref, prevlcv, &prevref, &prevlen);
+ else {
+ /* Ensure that the "prevref == ref" test below always
+ * fails, since we're starting from the beginning of
+ * the ppref array; that is, there is no previous
+ * chunk.
+ */
+ prevref = -1;
+ prevlen = 0;
+ }
/*
* now adjust reference counts in range. merge the first