summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/softraid_crypto.c4
-rw-r--r--sys/dev/softraid_raid0.c4
-rw-r--r--sys/dev/softraid_raid1.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index b602681b98d..ec1fef13ee2 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.33 2009/05/11 14:06:21 jsing Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.34 2009/06/02 11:38:51 deraadt Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -151,7 +151,7 @@ sr_crypto_getcryptop(struct sr_workunit *wu, int encrypt)
/* Select crypto session based on block number */
keyndx = blk >> SR_CRYPTO_KEY_BLKSHIFT;
- if (keyndx > SR_CRYPTO_MAXKEYS)
+ if (keyndx >= SR_CRYPTO_MAXKEYS)
goto unwind;
crp->crp_sid = sd->mds.mdd_crypto.scr_sid[keyndx];
if (crp->crp_sid == (u_int64_t)-1)
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index b3202858600..8584ab74d57 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.13 2009/05/11 14:06:21 jsing Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.14 2009/06/02 11:38:51 deraadt Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -188,7 +188,7 @@ sr_raid0_set_vol_state(struct sr_discipline *sd)
for (i = 0; i < nd; i++) {
s = sd->sd_vol.sv_chunks[i]->src_meta.scm_status;
- if (s > SR_MAX_STATES)
+ if (s >= SR_MAX_STATES)
panic("%s: %s: %s: invalid chunk state",
DEVNAME(sd->sd_sc),
sd->sd_meta->ssd_devname,
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c
index 1eda42004e8..6c10be2ea1a 100644
--- a/sys/dev/softraid_raid1.c
+++ b/sys/dev/softraid_raid1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid1.c,v 1.11 2009/06/02 05:49:35 marco Exp $ */
+/* $OpenBSD: softraid_raid1.c,v 1.12 2009/06/02 11:38:51 deraadt Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -209,7 +209,7 @@ sr_raid1_set_vol_state(struct sr_discipline *sd)
for (i = 0; i < nd; i++) {
s = sd->sd_vol.sv_chunks[i]->src_meta.scm_status;
- if (s > SR_MAX_STATES)
+ if (s >= SR_MAX_STATES)
panic("%s: %s: %s: invalid chunk state",
DEVNAME(sd->sd_sc),
sd->sd_meta->ssd_devname,