diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:42:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:42:25 -0400 |
commit | 84db18bbeb5c9c1a9c86e38a89d76ee526fd2c6f (patch) | |
tree | 49d3959eb24cd7c0754ed50e05fb96b0fb8d04aa /sound/pci/mixart | |
parent | 6948ec70355ae6cf6082519e3d76b280373dade1 (diff) | |
parent | 55b371d4ac5ed6f3338a398fbf9f2eb9ace78799 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: mixart: range checking proc file
ALSA: hda - Fix a wrong array range check in patch_realtek.c
ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
ALSA: hda - Enable amplifiers on Acer Inspire 6530G
ASoC: Only do WM8994 bias off transition from standby
ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices
ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
ASoC: Support second DC servo readback method for wm_hubs
ASoC: Avoid wraparound in wm_hubs DC servo correction
ALSA: echoaudio - Eliminate use after free
ALSA: i2c: cleanup: change parameter to pointer
ALSA: hda - Add MSI blacklist for Aopen MZ915-M
ASoC: OMAP: Fix capture pointer handling for OMAP1510 to work correctly with recent ALSA PCM code
ALSA: hda - Update document about MSI and interrupts
ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
ALSA: hda - Add missing printk argument in previous patch
ASoC: Fix passing platform_data to ac97 bus users and fix a leak
ALSA: hda - Fix ADC/MUX assignment of ALC269 codec
ALSA: hda - Fix invalid bit values passed to snd_hda_codec_amp_stereo()
ASoC: wm8994: playback => capture
Diffstat (limited to 'sound/pci/mixart')
-rw-r--r-- | sound/pci/mixart/mixart.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 55e9315d4cc..3be8f97c8bc 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -1162,13 +1162,15 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private | |||
1162 | unsigned long count, unsigned long pos) | 1162 | unsigned long count, unsigned long pos) |
1163 | { | 1163 | { |
1164 | struct mixart_mgr *mgr = entry->private_data; | 1164 | struct mixart_mgr *mgr = entry->private_data; |
1165 | unsigned long maxsize; | ||
1165 | 1166 | ||
1166 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1167 | if (pos >= MIXART_BA0_SIZE) |
1167 | if(count <= 0) | ||
1168 | return 0; | 1168 | return 0; |
1169 | if(pos + count > MIXART_BA0_SIZE) | 1169 | maxsize = MIXART_BA0_SIZE - pos; |
1170 | count = (long)(MIXART_BA0_SIZE - pos); | 1170 | if (count > maxsize) |
1171 | if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count)) | 1171 | count = maxsize; |
1172 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | ||
1173 | if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count)) | ||
1172 | return -EFAULT; | 1174 | return -EFAULT; |
1173 | return count; | 1175 | return count; |
1174 | } | 1176 | } |
@@ -1181,13 +1183,15 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private | |||
1181 | unsigned long count, unsigned long pos) | 1183 | unsigned long count, unsigned long pos) |
1182 | { | 1184 | { |
1183 | struct mixart_mgr *mgr = entry->private_data; | 1185 | struct mixart_mgr *mgr = entry->private_data; |
1186 | unsigned long maxsize; | ||
1184 | 1187 | ||
1185 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1188 | if (pos > MIXART_BA1_SIZE) |
1186 | if(count <= 0) | ||
1187 | return 0; | 1189 | return 0; |
1188 | if(pos + count > MIXART_BA1_SIZE) | 1190 | maxsize = MIXART_BA1_SIZE - pos; |
1189 | count = (long)(MIXART_BA1_SIZE - pos); | 1191 | if (count > maxsize) |
1190 | if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count)) | 1192 | count = maxsize; |
1193 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | ||
1194 | if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count)) | ||
1191 | return -EFAULT; | 1195 | return -EFAULT; |
1192 | return count; | 1196 | return count; |
1193 | } | 1197 | } |