prevent sa_setconcurrency before sa_enable, rather than crashing.

(savp_lwp is still null at that point.)

noted by skrueger at meinberlikomm.de.
This commit is contained in:
yamt 2005-09-05 21:52:38 +00:00
parent d462489ea5
commit af9e3184f8
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sa.c,v 1.63 2005/08/19 02:04:03 christos Exp $ */ /* $NetBSD: kern_sa.c,v 1.64 2005/09/05 21:52:38 yamt Exp $ */
/*- /*-
* Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc. * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.63 2005/08/19 02:04:03 christos Exp $"); __KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.64 2005/09/05 21:52:38 yamt Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -553,6 +553,9 @@ sys_sa_setconcurrency(struct lwp *l, void *v, register_t *retval)
if (sa == NULL) if (sa == NULL)
return (EINVAL); return (EINVAL);
if ((l->l_proc->p_flag & P_SA) == 0)
return (EINVAL);
if (SCARG(uap, concurrency) < 1) if (SCARG(uap, concurrency) < 1)
return (EINVAL); return (EINVAL);