diff options
Diffstat (limited to 'sound/pci/mixart/mixart.c')
-rw-r--r-- | sound/pci/mixart/mixart.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index b5df78bcc25..be95e005c81 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -1161,13 +1161,7 @@ static ssize_t snd_mixart_BA0_read(struct snd_info_entry *entry, | |||
1161 | size_t count, loff_t pos) | 1161 | size_t count, loff_t pos) |
1162 | { | 1162 | { |
1163 | struct mixart_mgr *mgr = entry->private_data; | 1163 | struct mixart_mgr *mgr = entry->private_data; |
1164 | unsigned long maxsize; | ||
1165 | 1164 | ||
1166 | if (pos >= MIXART_BA0_SIZE) | ||
1167 | return 0; | ||
1168 | maxsize = MIXART_BA0_SIZE - pos; | ||
1169 | if (count > maxsize) | ||
1170 | count = maxsize; | ||
1171 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1165 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ |
1172 | if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count)) | 1166 | if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count)) |
1173 | return -EFAULT; | 1167 | return -EFAULT; |
@@ -1183,13 +1177,7 @@ static ssize_t snd_mixart_BA1_read(struct snd_info_entry *entry, | |||
1183 | size_t count, loff_t pos) | 1177 | size_t count, loff_t pos) |
1184 | { | 1178 | { |
1185 | struct mixart_mgr *mgr = entry->private_data; | 1179 | struct mixart_mgr *mgr = entry->private_data; |
1186 | unsigned long maxsize; | ||
1187 | 1180 | ||
1188 | if (pos > MIXART_BA1_SIZE) | ||
1189 | return 0; | ||
1190 | maxsize = MIXART_BA1_SIZE - pos; | ||
1191 | if (count > maxsize) | ||
1192 | count = maxsize; | ||
1193 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1181 | 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)) | 1182 | if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count)) |
1195 | return -EFAULT; | 1183 | return -EFAULT; |