diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-11-27 04:59:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-28 12:34:36 -0500 |
commit | 3c02a6d946657e1ae0688e0d89f2dd2cfe9afba8 (patch) | |
tree | ef88905c7402e3b79250d51563c94fc23eb9f141 | |
parent | 8f5abe842e84ba9e72485ddd9dc02a3562b54e2a (diff) |
Revert "ALSA: usb-audio: Fix potential zero-division at parsing FU"
The commit 8428a8ebde2d ("ALSA: usb-audio: Fix potential zero-division
at parsing FU") is utterly bogus and breaks the case with csize=1
instead of fixing anything. Just take it back again.
Reported-by: Jörg Otte <jrg.otte@gmail.com>
Fixes: 8428a8ebde2d ("ALSA: usb-audio: Fix potential zero-division at parsing FU"
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | sound/usb/mixer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 0537c6322990..61b348383de8 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -1476,9 +1476,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, | |||
1476 | return -EINVAL; | 1476 | return -EINVAL; |
1477 | } | 1477 | } |
1478 | csize = hdr->bControlSize; | 1478 | csize = hdr->bControlSize; |
1479 | if (csize <= 1) { | 1479 | if (!csize) { |
1480 | usb_audio_dbg(state->chip, | 1480 | usb_audio_dbg(state->chip, |
1481 | "unit %u: invalid bControlSize <= 1\n", | 1481 | "unit %u: invalid bControlSize == 0\n", |
1482 | unitid); | 1482 | unitid); |
1483 | return -EINVAL; | 1483 | return -EINVAL; |
1484 | } | 1484 | } |