diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c index 038b7aa94ba0..562ba7d0ef63 100644 --- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c @@ -1620,7 +1620,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd) if (prtd->last_buffer) { pr_debug("%s: last buffer drain\n", __func__); rc = msm_compr_drain_buffer(prtd, &flags); - if (rc) { + if (rc || !atomic_read(&prtd->start)) { spin_unlock_irqrestore(&prtd->lock, flags); break; @@ -1639,7 +1639,7 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd) /* wait for the zero length buffer to be returned */ pr_debug("%s: zero length buffer drain\n", __func__); rc = msm_compr_drain_buffer(prtd, &flags); - if (rc) { + if (rc || !atomic_read(&prtd->start)) { spin_unlock_irqrestore(&prtd->lock, flags); break; }