[alsa-devel] [PATCH] ASoC: Intel: Skylake: Fix to fail safely if module not available in path
Subhransu S. Prusty
subhransu.s.prusty at intel.com
Tue Dec 20 08:16:45 CET 2016
From: G Kranthi <gudishax.kranthikumar at intel.com>
If a module is not available in a pipeline, fail safely rather than
causing oops.
Signed-off-by: G Kranthi <gudishax.kranthikumar at intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty at intel.com>
---
sound/soc/intel/skylake/skl-pcm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 10fa10d..7e97ae6 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -254,6 +254,9 @@ static int skl_pcm_open(struct snd_pcm_substream *substream,
snd_pcm_set_sync(substream);
mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
+ if (!mconfig)
+ return -EINVAL;
+
skl_tplg_d0i3_get(skl, mconfig->d0i3_caps);
return 0;
--
1.9.1
More information about the Alsa-devel
mailing list