Grab kernel_lock for cpu_reboot().

This commit is contained in:
ad 2008-04-23 13:40:17 +00:00
parent 968ad4b4c3
commit 8d0205c623
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_xxx_12.c,v 1.13 2007/12/20 23:02:44 dsl Exp $ */ /* $NetBSD: kern_xxx_12.c,v 1.14 2008/04/23 13:40:17 ad Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1989, 1993 * Copyright (c) 1982, 1986, 1989, 1993
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.13 2007/12/20 23:02:44 dsl Exp $"); __KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.14 2008/04/23 13:40:17 ad Exp $");
/*#ifdef COMPAT_12*/ /*#ifdef COMPAT_12*/
@ -57,7 +57,9 @@ compat_12_sys_reboot(struct lwp *l, const struct compat_12_sys_reboot_args *uap,
if ((error = kauth_authorize_system(l->l_cred, if ((error = kauth_authorize_system(l->l_cred,
KAUTH_SYSTEM_REBOOT, 0, NULL, NULL, NULL)) != 0) KAUTH_SYSTEM_REBOOT, 0, NULL, NULL, NULL)) != 0)
return (error); return (error);
KERNEL_LOCK(1, NULL);
cpu_reboot(SCARG(uap, opt), NULL); cpu_reboot(SCARG(uap, opt), NULL);
KERNEL_UNLOCK_ONE(NULL);
return (0); return (0);
} }
/*#endif COMPAT_12 */ /*#endif COMPAT_12 */