Skip to content

Commit 12d7666

Browse files
ribaldaksacilotto
authored andcommitted
ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete
BugLink: https://bugs.launchpad.net/bugs/1916056 [ Upstream commit c1c3ba1 ] If dobj->control is not initialized we end up in an OOPs during skl_tplg_complete: [ 26.553358] BUG: kernel NULL pointer dereference, address: 0000000000000078 [ 26.561151] #PF: supervisor read access in kernel mode [ 26.566897] #PF: error_code(0x0000) - not-present page [ 26.572642] PGD 0 P4D 0 [ 26.575479] Oops: 0000 [#1] PREEMPT SMP PTI [ 26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G C 5.4.81 #4 [ 26.588232] Hardware name: HP Soraka/Soraka, BIOS Google_Soraka.10431.106.0 12/03/2019 [ 26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl] Fixes: 2d744ec ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL") Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Tested-by: Lukasz Majczak <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 23aab66 commit 12d7666

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sound/soc/intel/skylake/skl-topology.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,15 +3619,16 @@ static void skl_tplg_complete(struct snd_soc_component *component)
36193619

36203620
list_for_each_entry(dobj, &component->dobj_list, list) {
36213621
struct snd_kcontrol *kcontrol = dobj->control.kcontrol;
3622-
struct soc_enum *se =
3623-
(struct soc_enum *)kcontrol->private_value;
3624-
char **texts = dobj->control.dtexts;
3622+
struct soc_enum *se;
3623+
char **texts;
36253624
char chan_text[4];
36263625

3627-
if (dobj->type != SND_SOC_DOBJ_ENUM ||
3628-
dobj->control.kcontrol->put !=
3629-
skl_tplg_multi_config_set_dmic)
3626+
if (dobj->type != SND_SOC_DOBJ_ENUM || !kcontrol ||
3627+
kcontrol->put != skl_tplg_multi_config_set_dmic)
36303628
continue;
3629+
3630+
se = (struct soc_enum *)kcontrol->private_value;
3631+
texts = dobj->control.dtexts;
36313632
sprintf(chan_text, "c%d", mach->mach_params.dmic_num);
36323633

36333634
for (i = 0; i < se->items; i++) {

0 commit comments

Comments
 (0)