aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorCameron Grant <cg@FreeBSD.org>2001-06-18 00:10:47 +0000
committerCameron Grant <cg@FreeBSD.org>2001-06-18 00:10:47 +0000
commit74ffd13814eb9a0fcf68317a7b0827b1535f42b3 (patch)
tree46512e528b7c30d47016c9906c58ea1a881f196f /sys/dev
parentfaeebea2b838205e057452094691ca3bed5b5215 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sound/pcm/dsp.c4
-rw-r--r--sys/dev/sound/pcm/sndstat.c2
-rw-r--r--sys/dev/sound/pcm/sound.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 81d75da9f446..2652d9afeae3 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -66,7 +66,7 @@ dsp_get_info(dev_t dev)
int unit;
unit = PCMUNIT(dev);
- if (unit > devclass_get_maxunit(pcm_devclass))
+ if (unit >= devclass_get_maxunit(pcm_devclass))
return NULL;
d = devclass_get_softc(pcm_devclass, unit);
@@ -1024,7 +1024,7 @@ dsp_clone(void *arg, char *name, int namelen, dev_t *dev)
return;
gotit:
- if (unit == -1 || unit > devclass_get_maxunit(pcm_devclass))
+ if (unit == -1 || unit >= devclass_get_maxunit(pcm_devclass))
return;
cont = 1;
diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
index 25c71ed7f55b..a16c07e85c7a 100644
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -140,7 +140,7 @@ sndstat_prepare(struct sbuf *s)
} else
sbuf_printf(s, "Installed devices:\n");
- for (i = 0; i <= devclass_get_maxunit(pcm_devclass); i++) {
+ for (i = 0; i < devclass_get_maxunit(pcm_devclass); i++) {
d = devclass_get_softc(pcm_devclass, i);
if (!d)
continue;
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index 89cd4d02d297..baf90e0ba199 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -163,7 +163,7 @@ sysctl_hw_sndunit(SYSCTL_HANDLER_ARGS)
unit = snd_unit;
error = sysctl_handle_int(oidp, &unit, sizeof(unit), req);
if (error == 0 && req->newptr != NULL) {
- if (unit < 0 || unit > devclass_get_maxunit(pcm_devclass))
+ if (unit < 0 || unit >= devclass_get_maxunit(pcm_devclass))
return EINVAL;
d = devclass_get_softc(pcm_devclass, unit);
if (d == NULL || SLIST_EMPTY(&d->channels))