diff options
author | Mark Brown <broonie@kernel.org> | 2016-08-24 14:05:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-24 14:05:18 -0400 |
commit | b5db6c57c9fb7068cf50e82c27886cc00b9cd78e (patch) | |
tree | b18ed42f82b3e6fe71c928662700503a23feabf5 | |
parent | ae16842306be347fa44ec6cc642d7f6ac8b7b889 (diff) | |
parent | 8053f21675b073b379cbca258ee4a3f3850dfa94 (diff) |
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
-rw-r--r-- | sound/soc/soc-dapm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8698c26773b3..d908ff8f9755 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -3493,6 +3493,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3493 | const struct snd_soc_pcm_stream *config = w->params + w->params_select; | 3493 | const struct snd_soc_pcm_stream *config = w->params + w->params_select; |
3494 | struct snd_pcm_substream substream; | 3494 | struct snd_pcm_substream substream; |
3495 | struct snd_pcm_hw_params *params = NULL; | 3495 | struct snd_pcm_hw_params *params = NULL; |
3496 | struct snd_pcm_runtime *runtime = NULL; | ||
3496 | u64 fmt; | 3497 | u64 fmt; |
3497 | int ret; | 3498 | int ret; |
3498 | 3499 | ||
@@ -3541,6 +3542,14 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3541 | 3542 | ||
3542 | memset(&substream, 0, sizeof(substream)); | 3543 | memset(&substream, 0, sizeof(substream)); |
3543 | 3544 | ||
3545 | /* Allocate a dummy snd_pcm_runtime for startup() and other ops() */ | ||
3546 | runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); | ||
3547 | if (!runtime) { | ||
3548 | ret = -ENOMEM; | ||
3549 | goto out; | ||
3550 | } | ||
3551 | substream.runtime = runtime; | ||
3552 | |||
3544 | switch (event) { | 3553 | switch (event) { |
3545 | case SND_SOC_DAPM_PRE_PMU: | 3554 | case SND_SOC_DAPM_PRE_PMU: |
3546 | substream.stream = SNDRV_PCM_STREAM_CAPTURE; | 3555 | substream.stream = SNDRV_PCM_STREAM_CAPTURE; |
@@ -3606,6 +3615,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3606 | } | 3615 | } |
3607 | 3616 | ||
3608 | out: | 3617 | out: |
3618 | kfree(runtime); | ||
3609 | kfree(params); | 3619 | kfree(params); |
3610 | return ret; | 3620 | return ret; |
3611 | } | 3621 | } |