From patchwork Tue Feb 25 14:37:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 3717481 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED3DA9F38B for ; Tue, 25 Feb 2014 14:38:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECBC8201CD for ; Tue, 25 Feb 2014 14:38:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AC8CF20121 for ; Tue, 25 Feb 2014 14:38:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91BF6265621; Tue, 25 Feb 2014 15:38:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 05857265603; Tue, 25 Feb 2014 15:38:24 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EE2E8265606; Tue, 25 Feb 2014 15:38:22 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id F1ED52655DE for ; Tue, 25 Feb 2014 15:38:15 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Feb 2014 06:37:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,540,1389772800"; d="scan'208";a="461949376" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.50]) by orsmga001.jf.intel.com with ESMTP; 25 Feb 2014 06:37:52 -0800 From: Jarkko Nikula To: alsa-devel@alsa-project.org Date: Tue, 25 Feb 2014 16:37:47 +0200 Message-Id: <1393339067-10307-1-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 1.8.5.3 Cc: Liam Girdwood , Jarkko Nikula , Mark Brown , Mika Westerberg , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: Intel: sst-acpi: Fix Oops in case of missing firmware X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Jarkko Nikula Acked-by: Liam Girdwood --- 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;