summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/bytcr_wm5102.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-02-12 01:11:19 +0000
committerMark Brown <broonie@kernel.org>2024-02-12 01:11:19 +0000
commit8c41be259973c9b8e283c7c28d385c7651e4a729 (patch)
tree9e3e861ae04295f77f43269440cf1623069b136e /sound/soc/intel/boards/bytcr_wm5102.c
parentc4b603c6e2df3a17831731d8bbec5c16fa7bbdf8 (diff)
parent930375d34de67e129566caca008de0bbc54a4646 (diff)
ASoC: Intel: Boards: Fix NULL pointer deref in BYT/CHT
Merge series from Hans de Goede <hdegoede@redhat.com>: While testing 6.8 on a Bay Trail device with a ALC5640 codec I noticed a regression in 6.8 which causes a NULL pointer deref in probe(). All BYT/CHT Intel machine drivers are affected. Patch 1/2 of this series fixes all of them. Patch 2/2 adds some small cleanups to cht_bsw_rt5645.c for issues which I noticed while working on 1/2.
Diffstat (limited to 'sound/soc/intel/boards/bytcr_wm5102.c')
-rw-r--r--sound/soc/intel/boards/bytcr_wm5102.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c
index 6978ebde6693..cccb5e90c0fe 100644
--- a/sound/soc/intel/boards/bytcr_wm5102.c
+++ b/sound/soc/intel/boards/bytcr_wm5102.c
@@ -605,7 +605,8 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
/* find index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_wm5102_dais); i++) {
- if (!strcmp(byt_wm5102_dais[i].codecs->name,
+ if (byt_wm5102_dais[i].codecs->name &&
+ !strcmp(byt_wm5102_dais[i].codecs->name,
"wm5102-codec")) {
dai_index = i;
break;