[alsa-devel] [PATCH 03/11] ASoC: Intel: Skylake: Fix potential NULL pointer dereference

Guneshwor Singh guneshwor.o.singh at intel.com
Tue Nov 7 11:46:18 CET 2017


From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>

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 at intel.com>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh at intel.com>
---
 sound/soc/intel/skylake/skl-pcm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 4380e40c6af0..1dd97479e0c0 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,
 	}
 
 	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);
 }
-- 
2.14.2



More information about the Alsa-devel mailing list