summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2014-10-29 15:47:35 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-01-15 21:18:33 -0600
commit327f048263055cb199361655f86db2b9a15b2a62 (patch)
treea3c23270371cf8e5772959bbd1ca65c239bc7a8f /sound
parentaed1f7680de6ba5ae167e7358beb078110a8dabc (diff)
MLK-9760: ASoC: fsl_esai: fix NULL pointer issue in reset handler
When test with case arecord -Dhw:0,1 | aplay -Dhw:0,0, xrun happened, the reset handler will be called, but for BE(backend) stream, the substream->ops is null. This patch is to fix this null pointer issue. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 4db112a8cd3caf5a553afea88cf7fe8d9781f459)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_esai.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index f7c84d2ad22c..3182558a16d9 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -775,7 +775,8 @@ static int stop_lock_stream(struct snd_pcm_substream *substream)
{
if (substream) {
snd_pcm_stream_lock_irq(substream);
- if (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING)
+ if (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING
+ && substream->ops)
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
}
return 0;
@@ -784,7 +785,8 @@ static int stop_lock_stream(struct snd_pcm_substream *substream)
static int start_unlock_stream(struct snd_pcm_substream *substream)
{
if (substream) {
- if (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING)
+ if (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING
+ && substream->ops)
substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_START);
snd_pcm_stream_unlock_irq(substream);
}