Skip to contentSkip to conversation

ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware

PATCH Applied Jarkko Nikula 4 participants 4 messages Feb 25, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware

I swear I tested missing firmware in commit e5161d7987f1 ("ASoC: Intel:
sst-acpi: Request firmware before SST platform driver probing").

Unfortunately same wasn't done in commit 6dda27cbbd1d ("ASoC: Intel:
sst-acpi: Add support for multiple machine drivers per platform") which will cause NULL pointer dereference in sst_acpi_fw_cb() when printing the error since sst_acpi->mach is not set.

Fix this obvious error by setting the sst_acpi->mach in sst_acpi_probe().

---
 sound/soc/intel/sst-acpi.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/sst-acpi.c +1 -0
index 0bb43169e146..5d06eecb6198 100644
@@ -139,6 +139,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 	sst_pdata = &sst_acpi->sst_pdata;
 	sst_pdata->id = desc->sst_id;
 	sst_acpi->desc = desc;
+	sst_acpi->mach = mach;
 
 	if (desc->resindex_dma_base >= 0) {
 		sst_pdata->dma_engine = desc->dma_engine;
Signature · 1 line
1.8.5.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jarkko Nikula

I swear I tested missing firmware in commit e5161d7987f1 ("ASoC: Intel:
sst-acpi: Request firmware before SST platform driver probing").

Unfortunately same wasn't done in commit 6dda27cbbd1d ("ASoC: Intel:
sst-acpi: Add support for multiple machine drivers per platform") which will cause NULL pointer dereference in sst_acpi_fw_cb() when printing the error since sst_acpi->mach is not set.

Quoted 4 lines

Fix this obvious error by setting the sst_acpi->mach in sst_acpi_probe().

#2 lore raw
In reply to Jarkko Nikula
Quoted 9 lines · Jarkko Nikula

I swear I tested missing firmware in commit e5161d7987f1 ("ASoC: Intel:
sst-acpi: Request firmware before SST platform driver probing").

Unfortunately same wasn't done in commit 6dda27cbbd1d ("ASoC: Intel:
sst-acpi: Add support for multiple machine drivers per platform") which will cause NULL pointer dereference in sst_acpi_fw_cb() when printing the error since sst_acpi->mach is not set.

Fix this obvious error by setting the sst_acpi->mach in sst_acpi_probe().

FWIW, I did test with the patch set from lrg's tree as of a couple days ago, and hit this crash. So I can confirm the bug for sure. I'll test the fix with a new kernel build in a couple of hours.

Signature · 4 lines
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net
maintainer Applied
#3 lore raw
In reply to Jarkko Nikula
Quoted 2 lines · Jarkko Nikula

I swear I tested missing firmware in commit e5161d7987f1 ("ASoC: Intel:
sst-acpi: Request firmware before SST platform driver probing").

Applied, thanks.