From: Kulikov Vasiliy Date: Wed, 28 Jul 2010 16:40:51 +0000 (+0400) Subject: ALSA: sb: check get_user() return value X-Git-Tag: v2.6.36-rc1~493^2^2~7 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=5157cc8113db3de60ab6320965331c63bc77003c;p=~emulex%2Finfiniband.git 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 Signed-off-by: Takashi Iwai --- 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 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++; }