aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-02-13 15:03:34 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2013-02-13 15:03:58 +0700
commit5f9dde0757e557d16685d29b21a6055025ec252e (patch)
tree5f34dae1bcf94f1865c18ba9aced566abeb855b7 /sound
parent6b5ed324376aa451c3a51e367148da41c21ae36a (diff)
parenta96dbfbcb58afeec72c2a0a03d205e0e1457ea3d (diff)
downloadkernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.zip
kernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.tar.gz
kernel_samsung_aries-5f9dde0757e557d16685d29b21a6055025ec252e.tar.bz2
Merge 3.0.63
Change-Id: I9a9716dcb833c128a649864690169473ec4739e1
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/mixer.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 1d369e2..4d68f90 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1238,16 +1238,23 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
}
channels = (hdr->bLength - 7) / csize - 1;
bmaControls = hdr->bmaControls;
+ if (hdr->bLength < 7 + csize) {
+ snd_printk(KERN_ERR "usbaudio: unit %u: "
+ "invalid UAC_FEATURE_UNIT descriptor\n",
+ unitid);
+ return -EINVAL;
+ }
} else {
struct uac2_feature_unit_descriptor *ftr = _ftr;
csize = 4;
channels = (hdr->bLength - 6) / 4 - 1;
bmaControls = ftr->bmaControls;
- }
-
- if (hdr->bLength < 7 || !csize || hdr->bLength < 7 + csize) {
- snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid);
- return -EINVAL;
+ if (hdr->bLength < 6 + csize) {
+ snd_printk(KERN_ERR "usbaudio: unit %u: "
+ "invalid UAC_FEATURE_UNIT descriptor\n",
+ unitid);
+ return -EINVAL;
+ }
}
/* parse the source unit */