diff options
-rw-r--r-- | sys/dev/pci/envy.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/sv.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c index 3a2c25f08ce..7b56074de4d 100644 --- a/sys/dev/pci/envy.c +++ b/sys/dev/pci/envy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envy.c,v 1.4 2007/12/08 10:01:28 ratchov Exp $ */ +/* $OpenBSD: envy.c,v 1.5 2008/01/14 01:23:53 jakemsr Exp $ */ /* * Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org> * @@ -840,6 +840,9 @@ envy_query_devinfo(void *self, struct mixer_devinfo *dev) }; /* XXX: define AudioCsource */ + if (dev->index < 0) + return ENXIO; + dev->prev = dev->next = AUDIO_MIXER_LAST; if (dev->index < ENVY_MIX_OUTSRC) { dev->type = AUDIO_MIXER_CLASS; diff --git a/sys/dev/pci/sv.c b/sys/dev/pci/sv.c index 78a2888cec8..76be6bf66d6 100644 --- a/sys/dev/pci/sv.c +++ b/sys/dev/pci/sv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sv.c,v 1.22 2007/11/05 00:17:28 jakemsr Exp $ */ +/* $OpenBSD: sv.c,v 1.23 2008/01/14 01:23:53 jakemsr Exp $ */ /* * Copyright (c) 1998 Constantine Paul Sapuntzakis @@ -1027,6 +1027,9 @@ sv_query_devinfo(addr, dip) mixer_devinfo_t *dip; { + if (dip->index < 0) + return (ENXIO); + /* It's a class */ if (dip->index <= SV_LAST_CLASS) { dip->type = AUDIO_MIXER_CLASS; |