diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2008-12-19 16:11:04 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2008-12-19 16:11:04 +0000 |
| commit | 931346f9f03ecf69f482127e15d80b8ba3b0a8a2 (patch) | |
| tree | ae573d6884e8f27aa0a43a6a7b73e4acfc8cbc2d /sys/fs/procfs/procfs_map.c | |
| parent | 2baf651277848bc6b05fb93e87662c383f029551 (diff) | |
Notes
Diffstat (limited to 'sys/fs/procfs/procfs_map.c')
| -rw-r--r-- | sys/fs/procfs/procfs_map.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index f570e04963f0..64c6f5f2870d 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -53,6 +53,7 @@ #include <fs/procfs/procfs.h> #include <vm/vm.h> +#include <vm/vm_extern.h> #include <vm/pmap.h> #include <vm/vm_map.h> #include <vm/vm_page.h> @@ -82,7 +83,8 @@ extern struct sysentvec ia32_freebsd_sysvec; int procfs_doprocmap(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; @@ -109,6 +111,10 @@ procfs_doprocmap(PFS_FILL_ARGS) } #endif + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -236,5 +242,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } |
