Commit 3c02a6d9 authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds

Revert "ALSA: usb-audio: Fix potential zero-division at parsing FU"

The commit 8428a8eb ("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: default avatarJörg Otte <jrg.otte@gmail.com>
Fixes: 8428a8eb ("ALSA: usb-audio: Fix potential zero-division at parsing FU"
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8f5abe84
...@@ -1476,9 +1476,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, ...@@ -1476,9 +1476,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
return -EINVAL; return -EINVAL;
} }
csize = hdr->bControlSize; csize = hdr->bControlSize;
if (csize <= 1) { if (!csize) {
usb_audio_dbg(state->chip, usb_audio_dbg(state->chip,
"unit %u: invalid bControlSize <= 1\n", "unit %u: invalid bControlSize == 0\n",
unitid); unitid);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment