diff options
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index a533d86..8682d62 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -182,6 +182,7 @@ execve(td, uap) imgp->interpreter_name[0] = '\0'; imgp->auxargs = NULL; imgp->vp = NULL; + imgp->object = NULL; imgp->firstpage = NULL; imgp->ps_strings = 0; imgp->auxarg_size = 0; @@ -227,6 +228,8 @@ interpret: VOP_UNLOCK(imgp->vp, 0, td); goto exec_fail_dealloc; } + VOP_GETVOBJECT(imgp->vp, &imgp->object); + vm_object_reference(imgp->object); error = exec_map_first_page(imgp); VOP_UNLOCK(imgp->vp, 0, td); @@ -270,6 +273,8 @@ interpret: /* free name buffer and old vnode */ NDFREE(ndp, NDF_ONLY_PNBUF); vrele(ndp->ni_vp); + vm_object_deallocate(imgp->object); + imgp->object = NULL; /* set new name to that of the interpreter */ NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, imgp->interpreter_name, td); @@ -519,6 +524,9 @@ exec_fail_dealloc: vrele(imgp->vp); } + if (imgp->object) + vm_object_deallocate(imgp->object); + if (error == 0) goto done2; |