diff options
author | Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> | 2017-11-07 05:46:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-08 13:56:13 -0500 |
commit | 0265ddd7b713bd8b68a9ec451761bcb87bbac4b3 (patch) | |
tree | be0de8f2430ae43e18aa3d9c3c4dede9f2546152 | |
parent | da3417fe1f6d54c864b05fd5710979bdffe78034 (diff) |
ASoC: Intel: Skylake: Fix potential NULL pointer dereference
Pointer 'mconfig' returned from call to skl_tplg_fe_get_cpr_module() can
be NULL. So check for the valid pointer before dereferencing.
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/skylake/skl-pcm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 2b1e513b1680..a3cb204e9640 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c | |||
@@ -355,7 +355,8 @@ static void skl_pcm_close(struct snd_pcm_substream *substream, | |||
355 | } | 355 | } |
356 | 356 | ||
357 | mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); | 357 | mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); |
358 | skl_tplg_d0i3_put(skl, mconfig->d0i3_caps); | 358 | if (mconfig) |
359 | skl_tplg_d0i3_put(skl, mconfig->d0i3_caps); | ||
359 | 360 | ||
360 | kfree(dma_params); | 361 | kfree(dma_params); |
361 | } | 362 | } |