From: Takashi Iwai Date: Mon, 28 Jan 2008 22:53:41 +0000 (+0100) Subject: [ALSA] Fix Oops with PCM OSS sync X-Git-Tag: v2.6.25-rc1~1127^2~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4939c660341d1439b8c70c3e006e7fc182f5111e;p=linux-2.6 [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/426 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 092c2d84a9..4c601b192d 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -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, runtime->oss.buffer, size1); + size1 /= runtime->channels; /* frames */ fs = snd_enter_user(); snd_pcm_lib_write(substream, (void __user *)runtime->oss.buffer, size1); snd_leave_user(fs);