summaryrefslogtreecommitdiff
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-23 11:28:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-23 11:28:05 -0800
commit0200971d2f6a5443869fae7ef8a5f4c8606e5446 (patch)
tree1c435ff313d6021e559f172afd4c17400f5b6682 /sound/usb/quirks.c
parent45196cee28a5bcfb6ddbe2bffa4270cbed66ae4b (diff)
parentcb74eb15ac88d6aacf7e58db1d8f8dadee710fd9 (diff)
downloadlinux-3.10-0200971d2f6a5443869fae7ef8a5f4c8606e5446.tar.gz
linux-3.10-0200971d2f6a5443869fae7ef8a5f4c8606e5446.tar.bz2
linux-3.10-0200971d2f6a5443869fae7ef8a5f4c8606e5446.zip
Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
sound fixes for 3.3-rc5 Just a collection of boring small fixes for ASoC, HD-audio Realtek and USB-audio drivers. * tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: snd-usb-caiaq: Fix the return of XRUN ASoC: ak4642: fixup HeadPhone L/R dapm settings ALSA: hda/realtek - Fix surround output regression on Acer Aspire 5935 ALSA: hda/realtek - Fix overflow of vol/sw check bitmap ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk() ASoC: wm8962: Fix sidetone enumeration texts
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a3ddac0deff..27817266867 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -132,10 +132,14 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
unsigned *rate_table = NULL;
fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL);
- if (! fp) {
+ if (!fp) {
snd_printk(KERN_ERR "cannot memdup\n");
return -ENOMEM;
}
+ if (fp->nr_rates > MAX_NR_RATES) {
+ kfree(fp);
+ return -EINVAL;
+ }
if (fp->nr_rates > 0) {
rate_table = kmemdup(fp->rate_table,
sizeof(int) * fp->nr_rates, GFP_KERNEL);