diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-05-31 06:07:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-05-31 06:07:15 -0400 |
commit | e37c83c06c2690157a989df40dc99a6b61c9ea15 (patch) | |
tree | 024dfb8b2c9abeec9ca7cb0c0136c276d9aacc91 /sound/pci/cs46xx/cs46xx_lib.c | |
parent | ce1f7d30766f6549db6fa0b9e595e0d26a5b7d9a (diff) | |
parent | 67a3e12b05e055c0415c556a315a3d3eb637e29e (diff) |
Merge commit 'v2.6.35-rc1' into for-2.6.36
Diffstat (limited to 'sound/pci/cs46xx/cs46xx_lib.c')
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 3f99a5e8528c..aad37082cb6e 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -2657,21 +2657,16 @@ static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { } | |||
2657 | * proc interface | 2657 | * proc interface |
2658 | */ | 2658 | */ |
2659 | 2659 | ||
2660 | static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_data, | 2660 | static ssize_t snd_cs46xx_io_read(struct snd_info_entry *entry, |
2661 | struct file *file, char __user *buf, | 2661 | void *file_private_data, |
2662 | unsigned long count, unsigned long pos) | 2662 | struct file *file, char __user *buf, |
2663 | size_t count, loff_t pos) | ||
2663 | { | 2664 | { |
2664 | long size; | ||
2665 | struct snd_cs46xx_region *region = entry->private_data; | 2665 | struct snd_cs46xx_region *region = entry->private_data; |
2666 | 2666 | ||
2667 | size = count; | 2667 | if (copy_to_user_fromio(buf, region->remap_addr + pos, count)) |
2668 | if (pos + (size_t)size > region->size) | 2668 | return -EFAULT; |
2669 | size = region->size - pos; | 2669 | return count; |
2670 | if (size > 0) { | ||
2671 | if (copy_to_user_fromio(buf, region->remap_addr + pos, size)) | ||
2672 | return -EFAULT; | ||
2673 | } | ||
2674 | return size; | ||
2675 | } | 2670 | } |
2676 | 2671 | ||
2677 | static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { | 2672 | static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { |