summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorG Kranthi <gudishax.kranthikumar@intel.com>2016-12-20 12:46:45 +0530
committerMark Brown <broonie@kernel.org>2016-12-31 18:55:00 +0000
commit91ce54978ccece323aa6df930249ff84a7d233c7 (patch)
tree474bd502bfc0e7998efc1e38d2eb6bf497eceab4 /sound
parent4a8b3a682be9addff7dbd16371fa8c34103b5c31 (diff)
ASoC: Intel: Skylake: Fix to fail safely if module not available in path
If a module is not available in a pipeline, fail safely rather than causing oops. Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 84b5101e6ca6..6c6b63a6b338 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -180,6 +180,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;