projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
818e2ea
)
ALSA: snd-usb: avoid dividing by zero on invalid input
author
Nicolai Krakowiak
<nicolai.krakowiak@gmail.com>
Thu, 4 Aug 2011 13:56:27 +0000
(15:56 +0200)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 16 Aug 2011 01:31:36 +0000
(18:31 -0700)
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>
sound/usb/mixer.c
patch
|
blob
|
history
diff --git
a/sound/usb/mixer.c
b/sound/usb/mixer.c
index c22fa76e363ae5699e9885cc548fdc28d25607b3..ee9aa087d8b5960e46bede2f58c2f3d1e91f6af1 100644
(file)
--- 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 {