Skip to content

Commit

Permalink
Revert "ALSA: usb-audio: Fix potential zero-division at parsing FU"
Browse files Browse the repository at this point in the history
The commit 8428a8e ("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 <[email protected]>
Fixes: 8428a8e ("ALSA: usb-audio: Fix potential zero-division at parsing FU"
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tiwai authored and torvalds committed Nov 28, 2017
1 parent 8f5abe8 commit 3c02a6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,9 +1476,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
return -EINVAL;
}
csize = hdr->bControlSize;
if (csize <= 1) {
if (!csize) {
usb_audio_dbg(state->chip,
"unit %u: invalid bControlSize <= 1\n",
"unit %u: invalid bControlSize == 0\n",
unitid);
return -EINVAL;
}
Expand Down

0 comments on commit 3c02a6d

Please sign in to comment.