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>
This commit is contained in:
Pankaj Bharadiya 2017-11-07 16:16:18 +05:30 committed by Mark Brown
parent da3417fe1f
commit 0265ddd7b7
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -355,7 +355,8 @@ static void skl_pcm_close(struct snd_pcm_substream *substream,
}
mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
skl_tplg_d0i3_put(skl, mconfig->d0i3_caps);
if (mconfig)
skl_tplg_d0i3_put(skl, mconfig->d0i3_caps);
kfree(dma_params);
}