Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH] ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware
Date: Tue, 25 Feb 2014 16:37:47 +0200	[thread overview]
Message-ID: <1393339067-10307-1-git-send-email-jarkko.nikula@linux.intel.com> (raw)

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().

Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 sound/soc/intel/sst-acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/sst-acpi.c b/sound/soc/intel/sst-acpi.c
index 0bb43169e146..5d06eecb6198 100644
--- a/sound/soc/intel/sst-acpi.c
+++ b/sound/soc/intel/sst-acpi.c
@@ -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;
-- 
1.8.5.3

             reply	other threads:[~2014-02-25 14:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 14:37 Jarkko Nikula [this message]
2014-02-25 14:42 ` [PATCH] ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware Liam Girdwood
2014-02-25 16:57 ` Adam Williamson
2014-02-25 23:47 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393339067-10307-1-git-send-email-jarkko.nikula@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox