From patchwork Thu Dec 11 07:21:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Strasser X-Patchwork-Id: 5474741 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 030459F1D4 for ; Thu, 11 Dec 2014 08:46:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FAE0201B9 for ; Thu, 11 Dec 2014 08:46:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 341EB2018E for ; Thu, 11 Dec 2014 08:46:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D0FE026517E; Thu, 11 Dec 2014 09:46:41 +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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 25E9D264F50; Thu, 11 Dec 2014 09:44:52 +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 B12FE2614F4; Thu, 11 Dec 2014 08:21:40 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 2E48D2612CD for ; Thu, 11 Dec 2014 08:21:31 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Dec 2014 23:21:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,556,1413270000"; d="scan'208";a="622033210" Received: from h87m.jf.intel.com ([10.7.197.214]) by orsmga001.jf.intel.com with ESMTP; 10 Dec 2014 23:21:30 -0800 From: Kevin Strasser To: alsa-devel@alsa-project.org Date: Wed, 10 Dec 2014 23:21:57 -0800 Message-Id: <1418282517-851-1-git-send-email-kevin.strasser@intel.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 11 Dec 2014 09:44:48 +0100 Cc: Vinod Koul , Mengdong Lin , Liam Girdwood , linux-kernel@vger.kernel.org, Yang Fang , Mark Brown Subject: [alsa-devel] [PATCH] ASoC: Intel: fix possible acpi enumeration panic 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 A crash can occur on some platforms where adsp is enumerated but codec is not matched. Check that the codec_id string is valid before attempting to match. Signed-off-by: Kevin Strasser --- sound/soc/intel/sst/sst_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c index 31124aa..dd72e58 100644 --- a/sound/soc/intel/sst/sst_acpi.c +++ b/sound/soc/intel/sst/sst_acpi.c @@ -236,7 +236,7 @@ static struct sst_machines *sst_acpi_find_machine( struct sst_machines *mach; bool found = false; - for (mach = machines; mach->codec_id; mach++) + for (mach = machines; mach->codec_id[0]; mach++) if (ACPI_SUCCESS(acpi_get_devices(mach->codec_id, sst_acpi_mach_match, &found, NULL)) && found)