execve1: move few PNBUF_PUT() outside the lock paths.

This commit is contained in:
rmind 2010-05-12 03:40:38 +00:00
parent 677688bd7f
commit 6bf9a07036
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exec.c,v 1.296 2010/05/02 23:22:51 dholland Exp $ */
/* $NetBSD: kern_exec.c,v 1.297 2010/05/12 03:40:38 rmind Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.296 2010/05/02 23:22:51 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.297 2010/05/12 03:40:38 rmind Exp $");
#include "opt_ktrace.h"
#include "opt_modular.h"
@ -1209,9 +1209,10 @@ execve1(struct lwp *l, const char *path, char * const *args,
lwp_lock(l);
l->l_flag |= oldlwpflags;
lwp_unlock(l);
PNBUF_PUT(pathbuf);
rw_exit(&p->p_reflock);
PNBUF_PUT(pathbuf);
if (modgen != module_gen && error == ENOEXEC) {
modgen = module_gen;
exec_autoload();
@ -1223,11 +1224,12 @@ execve1(struct lwp *l, const char *path, char * const *args,
exec_abort:
SDT_PROBE(proc,,,exec_failure, error, 0, 0, 0, 0);
PNBUF_PUT(pathbuf);
PNBUF_PUT(resolvedpathbuf);
rw_exit(&p->p_reflock);
rw_exit(&exec_lock);
PNBUF_PUT(pathbuf);
PNBUF_PUT(resolvedpathbuf);
/*
* the old process doesn't exist anymore. exit gracefully.
* get rid of the (new) address space we have created, if any, get rid