2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-16 02:05:43 +08:00
|
|
|
From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
|
|
|
|
Date: Wed, 6 Sep 2017 14:04:55 +0530
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] ASoC: Intel: Skylake: Fix codec_dai NULL pointer dereferening
|
2018-10-16 02:05:43 +08:00
|
|
|
|
|
|
|
Pointer 'codec_dai' returned from call to cnl_get_codec_dai() can be
|
|
|
|
NULL.
|
|
|
|
|
|
|
|
Check for the valid pointer before dereferencing.
|
|
|
|
|
|
|
|
Change-Id: I783b6220e32a9b8bf7655b92df7a4b034175a509
|
|
|
|
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
|
|
|
|
Reviewed-on:
|
|
|
|
Reviewed-by: Prusty, Subhransu S <subhransu.s.prusty@intel.com>
|
2018-10-30 05:21:52 +08:00
|
|
|
Reviewed-by: audio_build
|
2018-10-16 02:05:43 +08:00
|
|
|
Reviewed-by: Koul, Vinod <vinod.koul@intel.com>
|
|
|
|
Tested-by: Sm, Bhadur A <bhadur.a.sm@intel.com>
|
|
|
|
---
|
|
|
|
sound/soc/intel/boards/cnl_rt274.c | 2 ++
|
|
|
|
1 file changed, 2 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/sound/soc/intel/boards/cnl_rt274.c b/sound/soc/intel/boards/cnl_rt274.c
|
2020-10-27 02:14:06 +08:00
|
|
|
index 07a876f4f3b2..5570474806ab 100644
|
2018-10-16 02:05:43 +08:00
|
|
|
--- a/sound/soc/intel/boards/cnl_rt274.c
|
|
|
|
+++ b/sound/soc/intel/boards/cnl_rt274.c
|
|
|
|
@@ -76,6 +76,8 @@ static int cnl_rt274_clock_control(struct snd_soc_dapm_widget *w,
|
|
|
|
int ret = 0, ratio = 100;
|
|
|
|
struct snd_soc_dai *codec_dai = cnl_get_codec_dai(card,
|
|
|
|
RT274_CODEC_DAI);
|
|
|
|
+ if (!codec_dai)
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
|
|
/* Codec needs clock for Jack detection and button press */
|
|
|
|
ret = snd_soc_dai_set_sysclk(codec_dai, RT274_SCLK_S_PLL2,
|
|
|
|
--
|
2019-04-08 18:08:36 +08:00
|
|
|
https://clearlinux.org
|
2018-10-16 02:05:43 +08:00
|
|
|
|