summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-02-03 06:26:56 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-02-03 06:26:55 -0800
commit376ee68bbfb675f3a27a2e4ed6e3eade22b2de50 (patch)
tree42871650d25d8b6ec178a89adbb7ebf7d4513b0e /sound
parent49c12b3001cb4659ce3b8c83b95b00ec86253196 (diff)
parent6fd9409fbd029653f0939a5ae7225e6ddb2114a8 (diff)
Merge "ALSA: pcm: fix blocking while loop in snd_pcm_update_hw_ptr0()"
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 328b4a43f09a..b73133885384 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -375,7 +375,8 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
* the elapsed time to detect xruns.
*/
jdelta = curr_jiffies - runtime->hw_ptr_jiffies;
- if (jdelta < runtime->hw_ptr_buffer_jiffies / 2)
+ if ((jdelta < runtime->hw_ptr_buffer_jiffies / 2) ||
+ (runtime->hw_ptr_buffer_jiffies <= 0))
goto no_delta_check;
hdelta = jdelta - delta * HZ / runtime->rate;
xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1;