提交 5157cc81 编写于 作者: K Kulikov Vasiliy 提交者: Takashi Iwai

ALSA: sb: check get_user() return value

get_user() may fail, if so return -EFAULT.

[Fixed one missing place by tiwai]
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 63818c44
......@@ -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++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册