summaryrefslogtreecommitdiffstats
path: root/sys/dev/ksyms
diff options
context:
space:
mode:
authorsson <sson@FreeBSD.org>2009-05-27 16:20:46 +0000
committersson <sson@FreeBSD.org>2009-05-27 16:20:46 +0000
commit896c73926fc3bf33749f691d39765d0e288e0df1 (patch)
tree3e4fbba7ae719844a14ba9462af5226b718e5fe9 /sys/dev/ksyms
parent14ea3ee2bb371575697cd652ca2064877b187983 (diff)
downloadFreeBSD-src-896c73926fc3bf33749f691d39765d0e288e0df1.zip
FreeBSD-src-896c73926fc3bf33749f691d39765d0e288e0df1.tar.gz
Change from using vm_map_delete() to vm_map_remove().
Approved by: gnn (mentor) Obtained from: kib
Diffstat (limited to 'sys/dev/ksyms')
-rw-r--r--sys/dev/ksyms/ksyms.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/dev/ksyms/ksyms.c b/sys/dev/ksyms/ksyms.c
index 6283471..f725f06 100644
--- a/sys/dev/ksyms/ksyms.c
+++ b/sys/dev/ksyms/ksyms.c
@@ -395,29 +395,15 @@ static int
ksyms_unmap(struct thread *td, vm_offset_t addr, size_t sz)
{
vm_map_t map;
- int error;
vm_size_t size;
map = &td->td_proc->p_vmspace->vm_map;
-
size = (vm_size_t) round_page(sz);
- /* check for address wrap-around */
- if (addr + size < addr || addr < vm_map_min(map) ||
- addr + size > vm_map_max(map))
- return (EINVAL);
-
- vm_map_lock(map);
- /* make sure the pages are mapped */
- if (!vm_map_check_protection(map, addr, addr + size, VM_PROT_NONE)) {
- vm_map_unlock(map);
+ if (!vm_map_remove(map, addr, addr + size))
return (EINVAL);
- }
-
- error = vm_map_delete(map, addr, addr + size);
- vm_map_unlock(map);
- return (error);
+ return (0);
}
static void
OpenPOWER on IntegriCloud