summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/cht_bsw_rt5645.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/cht_bsw_rt5645.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/cht_bsw_rt5645.c')
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5645.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index c952a96cde7e..eb41b7115d01 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -40,7 +40,6 @@ struct cht_acpi_card {
struct cht_mc_private {
struct snd_soc_jack jack;
struct cht_acpi_card *acpi_card;
- char codec_name[SND_ACPI_I2C_ID_LEN];
struct clk *mclk;
};
@@ -567,14 +566,14 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
}
card->dev = &pdev->dev;
- sprintf(drv->codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
/* set correct codec name */
for (i = 0; i < ARRAY_SIZE(cht_dailink); i++)
- if (!strcmp(card->dai_link[i].codecs->name,
+ if (cht_dailink[i].codecs->name &&
+ !strcmp(cht_dailink[i].codecs->name,
"i2c-10EC5645:00")) {
- card->dai_link[i].codecs->name = drv->codec_name;
dai_index = i;
+ break;
}
/* fixup codec name based on HID */