summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-08-24 19:05:18 +0100
committerMark Brown <broonie@kernel.org>2016-08-24 19:05:18 +0100
commitb5db6c57c9fb7068cf50e82c27886cc00b9cd78e (patch)
treeb18ed42f82b3e6fe71c928662700503a23feabf5 /sound/soc
parentae16842306be347fa44ec6cc642d7f6ac8b7b889 (diff)
parent8053f21675b073b379cbca258ee4a3f3850dfa94 (diff)
downloadlinux-0-day-b5db6c57c9fb7068cf50e82c27886cc00b9cd78e.tar.gz
linux-0-day-b5db6c57c9fb7068cf50e82c27886cc00b9cd78e.tar.xz
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-dapm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8698c26773b3c..d908ff8f97554 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,
const struct snd_soc_pcm_stream *config = w->params + w->params_select;
struct snd_pcm_substream substream;
struct snd_pcm_hw_params *params = NULL;
+ struct snd_pcm_runtime *runtime = NULL;
u64 fmt;
int ret;
@@ -3541,6 +3542,14 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
memset(&substream, 0, sizeof(substream));
+ /* Allocate a dummy snd_pcm_runtime for startup() and other ops() */
+ runtime = kzalloc(sizeof(*runtime), GFP_KERNEL);
+ if (!runtime) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ substream.runtime = runtime;
+
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
substream.stream = SNDRV_PCM_STREAM_CAPTURE;
@@ -3606,6 +3615,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
}
out:
+ kfree(runtime);
kfree(params);
return ret;
}