Skip to contentSkip to conversation

ASoC: Intel: bxt*: Fix regression caused by COMP_DUMMY changes

PATCH In review Peter Ujfalusi 2 participants 4 messages Jan 8, 2024

Subsystems (3)
lore
Share & tools
lore

Peter Ujfalusi

author maintainer
#0 lore raw

cover ASoC: Intel: bxt*: Fix regression caused by COMP_DUMMY changes

Hi,

We just noticed that
13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()") caused regression (NULL pointer dereference) on GLK machines beacuse the drivers are using the codec name or dai_name to find the link to apply a fixup.

13f58267cda3 is sent for 6.8, so these patches are going to be needed to be able to boot these machines.

Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY
change
ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change

 sound/soc/intel/boards/bxt_da7219_max98357a.c | 6 ++++++
 sound/soc/intel/boards/bxt_rt298.c            | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/2 ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY change

The change to avoid dummy components will leave the component name and dai_name NULL which will cause NULL dereference when trying to access to it in the machine driver when applying fixups.

Fixes 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
---
 sound/soc/intel/boards/bxt_da7219_max98357a.c | 6 ++++++
 1 file changed, 6 insertions(+)
sound/soc/intel/boards/bxt_da7219_max98357a.c +6 -0
index 816fad8c1ff0..540f7a29310a 100644
@@ -797,6 +797,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 		broxton_audio_card.name = "glkda7219max";
 		/* Fixup the SSP entries for geminilake */
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs->dai_name)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 				    BXT_MAXIM_CODEC_DAI)) {
@@ -822,6 +825,9 @@ static int broxton_audio_probe(struct platform_device *pdev)
 			broxton_audio_card.name = "cmlda7219max";
 
 		for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
+			if (!broxton_dais[i].codecs->dai_name)
+				continue;
+
 			/* MAXIM_CODEC is connected to SSP1. */
 			if (!strcmp(broxton_dais[i].codecs->dai_name,
 					BXT_MAXIM_CODEC_DAI)) {
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 2/2 ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change

In reply to Peter Ujfalusi

The change to avoid dummy components will leave the component name and dai_name NULL which will cause NULL dereference when trying to access to it in the machine driver when applying fixups.

Fixes 13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()")
---
 sound/soc/intel/boards/bxt_rt298.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/boards/bxt_rt298.c +2 -1
index 4631106f2a28..c0eb65c14aa9 100644
@@ -604,7 +604,8 @@ static int broxton_audio_probe(struct platform_device *pdev)
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(broxton_rt298_dais); i++) {
-		if (!strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00",
+		if (card->dai_link[i].codecs->name &&
+		    !strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00",
 			     I2C_NAME_SIZE)) {
 			if (!strncmp(card->name, "broxton-rt298",
 				     PLATFORM_NAME_SIZE)) {
Signature · 1 line
2.43.0
maintainer
#3 lore raw
In reply to Peter Ujfalusi
Quoted 9 lines · Peter Ujfalusi

We just noticed that
13f58267cda3 ("ASoC: soc.h: don't create dummy Component via COMP_DUMMY()") caused regression (NULL pointer dereference) on GLK machines beacuse the drivers are using the codec name or dai_name to find the link to apply a fixup.

13f58267cda3 is sent for 6.8, so these patches are going to be needed to be able to boot these machines.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY change

      commit: 59b946ea30806064c4ac78f0ac93642655dd4f2e
[2/2] ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change
      commit: 3ec71290db4de298b67659ef2bc2a8f84cf9537b

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark