summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-02-05 14:48:03 +0100
committerTakashi Iwai <tiwai@suse.de>2013-02-05 14:48:03 +0100
commit2faea5274f079630991800bd579f85a621f96ef5 (patch)
tree4afb9032f0ae3a3e8b539e0abe40cda320989ac3 /sound/usb
parent16c5ab1d3a6d1b11ed2966fa33a3a4fecd13a2bc (diff)
parentedac894389f9c9de2a1368c78809c824b343f3a5 (diff)
downloadlinux-2faea5274f079630991800bd579f85a621f96ef5.tar.gz
linux-2faea5274f079630991800bd579f85a621f96ef5.tar.bz2
linux-2faea5274f079630991800bd579f85a621f96ef5.zip
Merge branch 'for-linus' into for-next
Merge pending fixes that haven't pulled into 3.8.
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer.c17
-rw-r--r--sound/usb/quirks-table.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ed4d89c8b52a..e90daf8cdaa8 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1331,16 +1331,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 */
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 64d25a7a4d59..820580a6dfc3 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -1750,7 +1750,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
/* .vendor_name = "Roland", */
/* .product_name = "A-PRO", */
- .ifnum = 1,
+ .ifnum = 0,
.type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = & (const struct snd_usb_midi_endpoint_info) {
.out_cables = 0x0003,