diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-08-16 15:18:55 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-08-16 15:18:55 +0000 |
commit | 902f24856b4bafac5d600164ea981cef6087cdb8 (patch) | |
tree | d9fad9722e6081e87d3e4efc2acaeb13d5f5f2b0 /sys | |
parent | 8bbf60981274b3673faf8ca4020e2d1c38d57ca5 (diff) |
I don't really know what I was thinking when I wrote this. Not only does the
"array" index start at 1, the code also abused index 0 to detect that we
were doing a KERN_POOL_NPOOLS.
Just look at *name == KERN_POOL_NPOOLS instead of using index == 0 for that.
deraadt@ ok
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_pool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index 536542a7ebb..f46e1adc68f 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.54 2007/05/28 23:46:28 tedu Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.55 2007/08/16 15:18:54 art Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -1913,7 +1913,7 @@ sysctl_dopool(int *name, u_int namelen, char *where, size_t *sizep) simple_unlock(&pool_head_slock); splx(s); - if (lookfor != 0 && foundpool == NULL) + if (*name != KERN_POOL_NPOOLS && foundpool == NULL) return (ENOENT); switch (*name) { |