Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4896903pxu; Thu, 10 Dec 2020 08:02:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDZCBxdkuHCvYvg6hMLhdWu4IltHpQciVH83PK2cfhz4/kKrQT+9weHNj9Nte/bW2AHW5L X-Received: by 2002:a50:bc15:: with SMTP id j21mr7404563edh.187.1607616120337; Thu, 10 Dec 2020 08:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607616120; cv=none; d=google.com; s=arc-20160816; b=A9KunQGzY3BfRl4uuiUcA8Wl0iaul1ZozKWMfUTHOrn1cAbxIbCUmKgrHvUV8PTD6O aRj3nV8/wNk9NoZhg4Lg/a2Rx5XEvbK6M1SH3sUHq+N7j5kYwZWfvu3HPWfUPp4bG52a m+XdlqUNItazpV/4L5wDZbrE/YnacnakP+WvySrGOdNyF6fDLgRuaj8VMya7bXNUCLsD Mp3GV79xt3hMMbP4jvBSrcavOOYqF2wOeh+wV2ZImdl/uBCo442WXKLLhx6NRXOgBlwY K11hGFFNFW1gvitKywXQJhBX9SFgjNbb2UOk4d7EYBNY4iCWfL8wXitpWTgAVz8FXUZX t6xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=I6remFfxfn1DbQ036AbRnVuVeGhwOBHn9aiv1QOLxPE=; b=05d0MTmQdZhFv4Cc+tqMhdQMzZVim0m+4Nxn6iTAMhJpaEKShf8WI2VMJF9By7SDWB rD6ocTatYh+Yy6paItQjlr83rQEDJ+E5MYNcTyhQzffLYa6yHE7aMDiQ2aNgryib/Owu Rq8s3EhlHH4/eFdGnGM9vxWDdDOFLL2J3ak6wa14AL7p9rRcg9JGsv9Ey5IJUUfgOPo+ D0l4i+Hj8gdAyk11F/O3vlTR86DL8AKj5sIjZ+rk35x3AVsP1ZF+vHUylmpzT05sYSbg Fmjq2KnKErESeL8d5rFEpdwlVjm1pUmP7UKD9ZfjRMP5zeLvOl/tHVOWL2o70re6cbL9 LP0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu3si3120685edb.376.2020.12.10.08.01.30; Thu, 10 Dec 2020 08:02:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391139AbgLJP56 (ORCPT + 99 others); Thu, 10 Dec 2020 10:57:58 -0500 Received: from mga01.intel.com ([192.55.52.88]:40076 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392075AbgLJP5e (ORCPT ); Thu, 10 Dec 2020 10:57:34 -0500 IronPort-SDR: DndN5pqvbd3zG+lfduwegh4JSuiBKEGDEHxe2HcAIoYnEpXvf9C4x7hHQ31v0QHh7jbPAyFyhE R5iyHKpnlsZg== X-IronPort-AV: E=McAfee;i="6000,8403,9830"; a="192599474" X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="192599474" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 07:55:45 -0800 IronPort-SDR: 3nkhWLCpQ6dAgMT9lORwAd8Jj7LQTaOWfcJOil6sKfSm0P33XjP5LeJlZlfS624xA3+aUm+ZjR b2qpEZaQKnEQ== X-IronPort-AV: E=Sophos;i="5.78,408,1599548400"; d="scan'208";a="319653427" Received: from mgorski-mobl.ger.corp.intel.com (HELO [10.213.11.242]) ([10.213.11.242]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 07:55:43 -0800 Subject: Re: [PATCH] ASoC: Intel: Skylake: Check the kcontrol against NULL To: Lukasz Majczak , Pierre-Louis Bossart , Liam Girdwood Cc: Marcin Wojtas , Radoslaw Biernacki , Alex Levin , Guenter Roeck , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20201210121438.7718-1-lma@semihalf.com> From: "Gorski, Mateusz" Message-ID: <43ecc9e6-3a86-6e7c-bb88-f87fbce0f51d@linux.intel.com> Date: Thu, 10 Dec 2020 16:55:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201210121438.7718-1-lma@semihalf.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pl Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > There is no check for the kcontrol against NULL and in some cases > it causes kernel to crash. > > Fixes: 2d744ecf2b984 ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT") > Cc: # 5.4+ > Signed-off-by: Lukasz Majczak > --- > sound/soc/intel/skylake/skl-topology.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c > index ae466cd592922..c9abbe4ff0ba3 100644 > --- a/sound/soc/intel/skylake/skl-topology.c > +++ b/sound/soc/intel/skylake/skl-topology.c > @@ -3618,12 +3618,18 @@ static void skl_tplg_complete(struct snd_soc_component *component) > int i; > > list_for_each_entry(dobj, &component->dobj_list, list) { > - struct snd_kcontrol *kcontrol = dobj->control.kcontrol; > - struct soc_enum *se = > - (struct soc_enum *)kcontrol->private_value; > - char **texts = dobj->control.dtexts; > + struct snd_kcontrol *kcontrol; > + struct soc_enum *se; > + char **texts; > char chan_text[4]; > > + kcontrol = dobj->control.kcontrol; > + if(!kcontrol) > + continue; > + > + se = (struct soc_enum *)kcontrol->private_value; > + texts = dobj->control.dtexts; > + > if (dobj->type != SND_SOC_DOBJ_ENUM || > dobj->control.kcontrol->put != > skl_tplg_multi_config_set_dmic) > > base-commit: 69fe63aa100220c8fd1f451dd54dd0895df1441d Thanks for pointing out and fixing this. This check was obviously missing there. I did a quick verification on few of our platforms, encountered no issues, so:     Reviewed-by: Mateusz Gorski Also, could you please: - describe the affected configuration (used machine driver or audio card name, device name), - share full dmesg logs from one of said crashes, - copy the output of "amixer -c0 controls" command executed on affected device. These would be useful information for us to further improve our validation and help us with debugging. Thanks, Mateusz