diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-28 12:40:51 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-29 06:24:22 -0400 |
commit | 5157cc8113db3de60ab6320965331c63bc77003c (patch) | |
tree | 38d4b65fc677ae528ee0cfbc6a1a238e698ceb32 | |
parent | 63818c448ac6f4dd75aa42997acaa746f86acb6b (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>
-rw-r--r-- | sound/isa/sb/emu8000_pcm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index ccedbfed061..2f85c66f8e3 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 | |||
433 | while (count > 0) { | 433 | while (count > 0) { |
434 | unsigned short sval; | 434 | unsigned short sval; |
435 | CHECK_SCHEDULER(); | 435 | CHECK_SCHEDULER(); |
436 | get_user(sval, buf); | 436 | if (get_user(sval, buf)) |
437 | return -EFAULT; | ||
437 | EMU8000_SMLD_WRITE(emu, sval); | 438 | EMU8000_SMLD_WRITE(emu, sval); |
438 | buf++; | 439 | buf++; |
439 | count--; | 440 | count--; |
@@ -525,12 +526,14 @@ static int emu8k_pcm_copy(struct snd_pcm_substream *subs, | |||
525 | while (count-- > 0) { | 526 | while (count-- > 0) { |
526 | unsigned short sval; | 527 | unsigned short sval; |
527 | CHECK_SCHEDULER(); | 528 | CHECK_SCHEDULER(); |
528 | get_user(sval, buf); | 529 | if (get_user(sval, buf)) |
530 | return -EFAULT; | ||
529 | EMU8000_SMLD_WRITE(emu, sval); | 531 | EMU8000_SMLD_WRITE(emu, sval); |
530 | buf++; | 532 | buf++; |
531 | if (rec->voices > 1) { | 533 | if (rec->voices > 1) { |
532 | CHECK_SCHEDULER(); | 534 | CHECK_SCHEDULER(); |
533 | get_user(sval, buf); | 535 | if (get_user(sval, buf)) |
536 | return -EFAULT; | ||
534 | EMU8000_SMRD_WRITE(emu, sval); | 537 | EMU8000_SMRD_WRITE(emu, sval); |
535 | buf++; | 538 | buf++; |
536 | } | 539 | } |