summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNicolai Krakowiak <nicolai.krakowiak@gmail.com>2011-08-04 15:56:27 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-15 18:31:36 -0700
commite565b49adb0dc11ac644e4af63936012c6ab2f43 (patch)
treedbbabff5c36d9c6cfe99fa8d448523e2a27f28fc /sound
parent818e2eaed9807b1816381856a10473cb58ca56e5 (diff)
ALSA: snd-usb: avoid dividing by zero on invalid input
commit 60c961a9e1ed879a4d151df6076bf1203f595f73 upstream. Signed-off-by: Nicolai Krakowiak <nicolai.krakowiak@gmail.com> Acked-by: Daniel Mack <zonque@gmail.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/mixer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index c22fa76e363a..ee9aa087d8b5 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1191,6 +1191,11 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
if (state->mixer->protocol == UAC_VERSION_1) {
csize = hdr->bControlSize;
+ if (!csize) {
+ snd_printdd(KERN_ERR "usbaudio: unit %u: "
+ "invalid bControlSize == 0\n", unitid);
+ return -EINVAL;
+ }
channels = (hdr->bLength - 7) / csize - 1;
bmaControls = hdr->bmaControls;
} else {