From c6da2cfeb05178a11c6d062a06f8078150ee492f Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 2 Jun 2012 13:09:29 +0200 Subject: samsung update 1 --- sound/core/control.c | 2 ++ sound/core/pcm_native.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sound/core') diff --git a/sound/core/control.c b/sound/core/control.c index f8c5be4..e9e79ec 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -118,6 +118,8 @@ static int snd_ctl_release(struct inode *inode, struct file *file) unsigned int idx; ctl = file->private_data; + if (snd_BUG_ON(!ctl || !ctl->card)) + return -ENXIO; file->private_data = NULL; card = ctl->card; write_lock_irqsave(&card->ctl_files_rwlock, flags); diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 1c6be91..20fc03a 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -866,8 +866,10 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, int state) struct snd_pcm_runtime *runtime = substream->runtime; snd_pcm_trigger_tstamp(substream); runtime->hw_ptr_jiffies = jiffies; - runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / - runtime->rate; + if (runtime->rate) { + runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / + runtime->rate; + } runtime->status->state = state; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && runtime->silence_size > 0) -- cgit v1.1