Commit 4939c660 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Fix Oops with PCM OSS sync

The PCM OSS emulation can cause Oops at sync operation due to the wrong
data size calculation.  Typically happening on Sparc64:
	http://lkml.org/lkml/2008/1/24/426Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent ce875f07
...@@ -1621,6 +1621,7 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file) ...@@ -1621,6 +1621,7 @@ static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file)
snd_pcm_format_set_silence(runtime->format, snd_pcm_format_set_silence(runtime->format,
runtime->oss.buffer, runtime->oss.buffer,
size1); size1);
size1 /= runtime->channels; /* frames */
fs = snd_enter_user(); fs = snd_enter_user();
snd_pcm_lib_write(substream, (void __user *)runtime->oss.buffer, size1); snd_pcm_lib_write(substream, (void __user *)runtime->oss.buffer, size1);
snd_leave_user(fs); snd_leave_user(fs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment