summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ac97.c
diff options
context:
space:
mode:
authorDeanna Phillips <deanna@cvs.openbsd.org>2008-01-13 21:43:02 +0000
committerDeanna Phillips <deanna@cvs.openbsd.org>2008-01-13 21:43:02 +0000
commit7880e847f5625f788f2313b077d4676e7341f0ff (patch)
treec876a284b17e28020434a7a9b68f4959a7f76f3a /sys/dev/ic/ac97.c
parentd31f7deef67f8c32893a17278052e371ff0ff09b (diff)
Check for a negative devinfo index, which could get here through
mixer_ioctl. ok jakemsr@
Diffstat (limited to 'sys/dev/ic/ac97.c')
-rw-r--r--sys/dev/ic/ac97.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c
index d19103ca1d3..14fdeaf6c45 100644
--- a/sys/dev/ic/ac97.c
+++ b/sys/dev/ic/ac97.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.c,v 1.64 2007/10/01 04:03:51 krw Exp $ */
+/* $OpenBSD: ac97.c,v 1.65 2008/01/13 21:43:01 deanna Exp $ */
/*
* Copyright (c) 1999, 2000 Constantine Sapuntzakis
@@ -831,7 +831,7 @@ ac97_query_devinfo(struct ac97_codec_if *codec_if, mixer_devinfo_t *dip)
{
struct ac97_softc *as = (struct ac97_softc *)codec_if;
- if (dip->index < as->num_source_info) {
+ if (dip->index < as->num_source_info && dip->index >= 0) {
struct ac97_source_info *si = &as->source_info[dip->index];
const char *name;