From ebb61891fb933bcb59f598a7c5b1d613f0f3eeb4 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 8 Mar 2014 06:06:42 +0000 Subject: [PATCH] Properly round on unmapping. --- sys/arm/at91/at91.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c index dce1f9341f5..384e1c113fc 100644 --- a/sys/arm/at91/at91.c +++ b/sys/arm/at91/at91.c @@ -84,8 +84,12 @@ at91_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) { vm_offset_t va, endva; + if (t == 0) + return; va = trunc_page((vm_offset_t)t); - endva = va + round_page(size); + if (va >= AT91_BASE && va <= AT91_BASE + 0xff00000) + return; + endva = round_page((vm_offset_t)t + size); /* Free the kernel virtual mapping. */ kva_free(va, endva - va);