]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "ALSA: usb-audio: Fix potential zero-division at parsing FU"
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Nov 2017 09:59:40 +0000 (10:59 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Nov 2017 17:34:36 +0000 (09:34 -0800)
The commit ddfbfdd1ff5d ("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: ddfbfdd1ff5d ("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>
sound/usb/mixer.c

index 0537c632299082eb1c40617491a77c964fb9c011..61b348383de88fa282028a78603567fa513589b7 100644 (file)
@@ -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;
                }