From e913ca22e2dbac5095790278a2d6c03ab23be919 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Wed, 10 Oct 2001 20:04:57 +0000 Subject: [PATCH] Move setregs() out from under the PROC_LOCK so that it can use functions list suword() which may trap. --- sys/kern/kern_exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 155cfec4d825..8cfeb74d9970 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -412,10 +412,6 @@ interpret: /* clear "fork but no exec" flag, as we _are_ execing */ p->p_acflag &= ~AFORK; - /* Set values passed into the program in registers. */ - setregs(td, imgp->entry_addr, (u_long)(uintptr_t)stack_base, - imgp->ps_strings); - /* Free any previous argument cache */ pa = p->p_args; p->p_args = NULL; @@ -423,6 +419,10 @@ interpret: if (pa != NULL && --pa->ar_ref == 0) FREE(pa, M_PARGS); + /* Set values passed into the program in registers. */ + setregs(td, imgp->entry_addr, (u_long)(uintptr_t)stack_base, + imgp->ps_strings); + /* Cache arguments if they fit inside our allowance */ i = imgp->endargs - imgp->stringbase; if (ps_arg_cache_limit >= i + sizeof(struct pargs)) {