summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorthib <thib@openbsd.org>2010-07-02 22:38:32 +0000
committerthib <thib@openbsd.org>2010-07-02 22:38:32 +0000
commit53e7e760c11f8a5728ae233c2937519eeb25f4c3 (patch)
tree884a403d459d4cf17809a0c046537a6898817e71 /sys
parentRemove the "fast" grep code if SMALL. This has the side effect of breaking (diff)
downloadwireguard-openbsd-53e7e760c11f8a5728ae233c2937519eeb25f4c3.tar.xz
wireguard-openbsd-53e7e760c11f8a5728ae233c2937519eeb25f4c3.zip
Don't bother trying to handle a uvm_pglistalloc failure when called with
UVM_PLA_WAITOK as it will not fail; Rather assert that it didn't fail. ok tedu@, oga@
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_glue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index e033a438ccc..4cc0d631c4d 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_glue.c,v 1.54 2010/07/02 20:40:16 thib Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.55 2010/07/02 22:38:32 thib Exp $ */
/* $NetBSD: uvm_glue.c,v 1.44 2001/02/06 19:54:44 eeh Exp $ */
/*
@@ -235,17 +235,17 @@ uvm_vslock_device(struct proc *p, void *addr, size_t len,
if ((va = uvm_km_valloc(kernel_map, sz)) == 0) {
return (ENOMEM);
}
+
TAILQ_INIT(&pgl);
- if (uvm_pglistalloc(npages * PAGE_SIZE, dma_constraint.ucr_low,
- dma_constraint.ucr_high, 0, 0, &pgl, npages, UVM_PLA_WAITOK)) {
- uvm_km_free(kernel_map, va, sz);
- return (ENOMEM);
- }
+ error = uvm_pglistalloc(npages * PAGE_SIZE, dma_constraint.ucr_low,
+ dma_constraint.ucr_high, 0, 0, &pgl, npages, UVM_PLA_WAITOK);
+ KASSERT(error == 0);
sva = va;
while ((pg = TAILQ_FIRST(&pgl)) != NULL) {
TAILQ_REMOVE(&pgl, pg, pageq);
- pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg), VM_PROT_READ|VM_PROT_WRITE);
+ pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
+ VM_PROT_READ|VM_PROT_WRITE);
va += PAGE_SIZE;
}
pmap_update(pmap_kernel());