diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-03-07 15:18:49 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-03-07 15:18:49 +0000 |
commit | 0c0e5fb4773da38d5b9945882eea829d59375441 (patch) | |
tree | ea794595ba93090fbebc96a13240cfc6d30c4b44 /sys/dev/usb | |
parent | 4afb978682ed6b07d8275c92627d369e1bb84b0a (diff) |
Fix use of uninitilized variable in case of emty AC descriptor.
USB audio devices with empty AC descriptor (i.e. emtpy devices) don't
exist as they would be of no use. So this fix is mostly to properly
skip broken hardware.
Found by coverity.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uaudio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index c2cd0c95897..a176a276cd7 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.148 2020/02/28 08:52:54 ratchov Exp $ */ +/* $OpenBSD: uaudio.c,v 1.149 2020/03/07 15:18:48 ratchov Exp $ */ /* * Copyright (c) 2018 Alexandre Ratchov <alex@caoua.org> * @@ -2045,7 +2045,7 @@ uaudio_process_ac(struct uaudio_softc *sc, struct uaudio_blob *p, int ifnum) * descriptor. This avoids relying on the wTotalLength field. */ savepos = p->rptr; - units.rptr = p->rptr; + units.rptr = units.wptr = p->rptr; while (p->rptr != p->wptr) { if (!uaudio_getdesc(p, &pu)) return 0; |