瀏覽代碼

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>
G Kranthi 8 年之前
父節點
當前提交
91ce54978c
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      sound/soc/intel/skylake/skl-pcm.c

+ 3 - 0
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;