summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2001-12-16 22:57:32 +0000
committeroster <oster@NetBSD.org>2001-12-16 22:57:32 +0000
commit3b488c3f27f035977f24c849def330ef35cef7fe (patch)
tree43afd8fc19881242182b6bbd93661145b7d95eaa /sys/dev/raidframe
parente53aabceccd40d7a8ce0fb828838a9511272a7d9 (diff)
Fix an off-by-one error when autoconfig is hunting for a free RAID
device in the rare event that the one it wants is already in use. Thanks to Wolfgang Stukenbrock for noticing the bug and filing the PR. This fix addresses PR#14862.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 823d05cbab6..9c2eb6e0af4 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.114 2001/11/28 05:39:13 lukem Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.115 2001/12/16 22:57:32 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -114,7 +114,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.114 2001/11/28 05:39:13 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.115 2001/12/16 22:57:32 oster Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -3293,7 +3293,7 @@ rf_auto_config_set(cset,unit)
not taken.
*/
- for(raidID = numraid; raidID >= 0; raidID--) {
+ for(raidID = numraid - 1; raidID >= 0; raidID--) {
if (raidPtrs[raidID]->valid == 0) {
/* can use this one! */
break;