Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/ia64/ia64 Fix a possible infinite loop in pmap_krem...
details: https://anonhg.NetBSD.org/src/rev/f6074ff76cc6
branches: trunk
changeset: 352575:f6074ff76cc6
user: scole <scole%NetBSD.org@localhost>
date: Sat Apr 08 20:59:27 2017 +0000
description:
Fix a possible infinite loop in pmap_kremove()
diffstat:
sys/arch/ia64/ia64/pmap.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r c34d9a6d89dd -r f6074ff76cc6 sys/arch/ia64/ia64/pmap.c
--- a/sys/arch/ia64/ia64/pmap.c Sat Apr 08 19:53:54 2017 +0000
+++ b/sys/arch/ia64/ia64/pmap.c Sat Apr 08 20:59:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $ */
+/* $NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2110,11 +2110,12 @@
pmap_kremove(vaddr_t va, vsize_t size)
{
struct ia64_lpte *pte;
-
+ vaddr_t eva = va + size;
+
UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
UVMHIST_LOG(maphist, "(va=%#lx)", va, 0, 0, 0);
- while (size > 0) {
+ while (va < eva) {
pte = pmap_find_kpte(va);
if (pmap_present(pte)) {
KASSERT(pmap_managed(pte) != 0);
@@ -2123,7 +2124,6 @@
pmap_clear_present(pte);
}
va += PAGE_SIZE;
- size -= PAGE_SIZE;
}
}
Home |
Main Index |
Thread Index |
Old Index