diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-07 03:54:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-07 03:54:33 -0400 |
commit | 1172234cbe94658c16bc83e50ca57b5a47085209 (patch) | |
tree | 15bddd783be48899167a9cd764d3f23cfd05572e | |
parent | 85255c0e078158ede61ff8bd296e306db6f7ed19 (diff) | |
parent | b0cc58a25d04160d39a80e436847eaa2fbc5aa09 (diff) |
Merge branch 'fix/misc' into for-linus
-rw-r--r-- | include/sound/ak4113.h | 2 | ||||
-rw-r--r-- | sound/i2c/other/ak4113.c | 2 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 5 | ||||
-rw-r--r-- | sound/pci/mixart/mixart.c | 24 |
4 files changed, 18 insertions, 15 deletions
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index 8988edae1609..2609048c1d44 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h | |||
@@ -307,7 +307,7 @@ struct ak4113 { | |||
307 | 307 | ||
308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, | 308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, |
309 | ak4113_write_t *write, | 309 | ak4113_write_t *write, |
310 | const unsigned char pgm[AK4113_WRITABLE_REGS], | 310 | const unsigned char *pgm, |
311 | void *private_data, struct ak4113 **r_ak4113); | 311 | void *private_data, struct ak4113 **r_ak4113); |
312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, | 312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, |
313 | unsigned char mask, unsigned char val); | 313 | unsigned char mask, unsigned char val); |
diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index fff62cc8607c..971a84a4fa77 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c | |||
@@ -70,7 +70,7 @@ static int snd_ak4113_dev_free(struct snd_device *device) | |||
70 | } | 70 | } |
71 | 71 | ||
72 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, | 72 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, |
73 | ak4113_write_t *write, const unsigned char pgm[5], | 73 | ak4113_write_t *write, const unsigned char *pgm, |
74 | void *private_data, struct ak4113 **r_ak4113) | 74 | void *private_data, struct ak4113 **r_ak4113) |
75 | { | 75 | { |
76 | struct ak4113 *chip; | 76 | struct ak4113 *chip; |
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 8dab82d7d19d..668a5ec04499 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -2184,10 +2184,9 @@ static int __devinit snd_echo_probe(struct pci_dev *pci, | |||
2184 | goto ctl_error; | 2184 | goto ctl_error; |
2185 | #endif | 2185 | #endif |
2186 | 2186 | ||
2187 | if ((err = snd_card_register(card)) < 0) { | 2187 | err = snd_card_register(card); |
2188 | snd_card_free(card); | 2188 | if (err < 0) |
2189 | goto ctl_error; | 2189 | goto ctl_error; |
2190 | } | ||
2191 | snd_printk(KERN_INFO "Card registered: %s\n", card->longname); | 2190 | snd_printk(KERN_INFO "Card registered: %s\n", card->longname); |
2192 | 2191 | ||
2193 | pci_set_drvdata(pci, chip); | 2192 | pci_set_drvdata(pci, chip); |
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 7e8e7da592a9..ea4256b08a38 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c | |||
@@ -1161,13 +1161,15 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private | |||
1161 | unsigned long count, unsigned long pos) | 1161 | unsigned long count, unsigned long pos) |
1162 | { | 1162 | { |
1163 | struct mixart_mgr *mgr = entry->private_data; | 1163 | struct mixart_mgr *mgr = entry->private_data; |
1164 | unsigned long maxsize; | ||
1164 | 1165 | ||
1165 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1166 | if (pos >= MIXART_BA0_SIZE) |
1166 | if(count <= 0) | ||
1167 | return 0; | 1167 | return 0; |
1168 | if(pos + count > MIXART_BA0_SIZE) | 1168 | maxsize = MIXART_BA0_SIZE - pos; |
1169 | count = (long)(MIXART_BA0_SIZE - pos); | 1169 | if (count > maxsize) |
1170 | if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count)) | 1170 | count = maxsize; |
1171 | 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)) | ||
1171 | return -EFAULT; | 1173 | return -EFAULT; |
1172 | return count; | 1174 | return count; |
1173 | } | 1175 | } |
@@ -1180,13 +1182,15 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private | |||
1180 | unsigned long count, unsigned long pos) | 1182 | unsigned long count, unsigned long pos) |
1181 | { | 1183 | { |
1182 | struct mixart_mgr *mgr = entry->private_data; | 1184 | struct mixart_mgr *mgr = entry->private_data; |
1185 | unsigned long maxsize; | ||
1183 | 1186 | ||
1184 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | 1187 | if (pos > MIXART_BA1_SIZE) |
1185 | if(count <= 0) | ||
1186 | return 0; | 1188 | return 0; |
1187 | if(pos + count > MIXART_BA1_SIZE) | 1189 | maxsize = MIXART_BA1_SIZE - pos; |
1188 | count = (long)(MIXART_BA1_SIZE - pos); | 1190 | if (count > maxsize) |
1189 | if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count)) | 1191 | count = maxsize; |
1192 | count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ | ||
1193 | if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count)) | ||
1190 | return -EFAULT; | 1194 | return -EFAULT; |
1191 | return count; | 1195 | return count; |
1192 | } | 1196 | } |