summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uaudio.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2019-05-09 06:58:14 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2019-05-09 06:58:14 +0000
commit8402fb0e6fc8f56e4bffe209b2673b324577ae88 (patch)
tree4abdbcc19a9c2da7037d179fa6b7f3cf981a34ad /sys/dev/usb/uaudio.c
parent6b36740a809fa3edf7d05bb4945039d5598ee2b5 (diff)
Skip empty control interfaces when parsing descriptors.
Even if having multiple control interface descriptors is not allowed by the UAC spec, there's no reason to stop as long as a proper control interface was processed.
Diffstat (limited to 'sys/dev/usb/uaudio.c')
-rw-r--r--sys/dev/usb/uaudio.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index f6d20ec384c..755678bd3ad 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.141 2019/05/01 14:51:40 ratchov Exp $ */
+/* $OpenBSD: uaudio.c,v 1.142 2019/05/09 06:58:13 ratchov Exp $ */
/*
* Copyright (c) 2018 Alexandre Ratchov <alex@caoua.org>
*
@@ -2620,7 +2620,6 @@ uaudio_process_conf(struct uaudio_softc *sc, struct uaudio_blob *p)
{
struct uaudio_blob dp;
unsigned int type, ifnum, altnum, nep, class, subclass;
- int nac = 0;
while (p->rptr != p->wptr) {
if (!uaudio_getdesc(p, &dp))
@@ -2647,14 +2646,12 @@ uaudio_process_conf(struct uaudio_softc *sc, struct uaudio_blob *p)
switch (subclass) {
case UISUBCLASS_AUDIOCONTROL:
usbd_claim_iface(sc->udev, ifnum);
- if (nac == 1) {
- printf("%s: only one AC iface allowed\n",
- DEVNAME(sc));
- return 0;
+ if (sc->unit_list != NULL) {
+ DPRINTF("%s: >1 AC ifaces\n", __func__);
+ goto done;
}
if (!uaudio_process_ac(sc, p, ifnum))
return 0;
- nac++;
break;
case UISUBCLASS_AUDIOSTREAM:
usbd_claim_iface(sc->udev, ifnum);
@@ -2667,7 +2664,7 @@ uaudio_process_conf(struct uaudio_softc *sc, struct uaudio_blob *p)
return 0;
}
}
-
+done:
uaudio_fixup_params(sc);
return 1;