summaryrefslogtreecommitdiff
path: root/sound/isa
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-28 20:40:51 +0400
committerTakashi Iwai <tiwai@suse.de>2010-07-29 12:24:22 +0200
commit5157cc8113db3de60ab6320965331c63bc77003c (patch)
tree38d4b65fc677ae528ee0cfbc6a1a238e698ceb32 /sound/isa
parent63818c448ac6f4dd75aa42997acaa746f86acb6b (diff)
ALSA: sb: check get_user() return value
get_user() may fail, if so return -EFAULT. [Fixed one missing place by tiwai] Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/sb/emu8000_pcm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
index ccedbfed061a..2f85c66f8e38 100644
--- a/sound/isa/sb/emu8000_pcm.c
+++ b/sound/isa/sb/emu8000_pcm.c
@@ -433,7 +433,8 @@ static int emu8k_transfer_block(struct snd_emu8000 *emu, int offset, unsigned sh
while (count > 0) {
unsigned short sval;
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMLD_WRITE(emu, sval);
buf++;
count--;
@@ -525,12 +526,14 @@ static int emu8k_pcm_copy(struct snd_pcm_substream *subs,
while (count-- > 0) {
unsigned short sval;
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMLD_WRITE(emu, sval);
buf++;
if (rec->voices > 1) {
CHECK_SCHEDULER();
- get_user(sval, buf);
+ if (get_user(sval, buf))
+ return -EFAULT;
EMU8000_SMRD_WRITE(emu, sval);
buf++;
}