Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4738113pxu; Thu, 10 Dec 2020 04:24:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJym0l8iUv8VdL8dMnvuoUzq8wr/8qvS3No0l0s4YREsR4K3brv4CpLp8UMhx5NpNUIDmZow X-Received: by 2002:a17:906:1498:: with SMTP id x24mr5981498ejc.170.1607603098249; Thu, 10 Dec 2020 04:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607603098; cv=none; d=google.com; s=arc-20160816; b=SPuciLHzApAH91aDCQ8ybyQ5ybFfF2ew6HEhxQNQadmYSxUYlAu8FXPCeq+w3aMaug SM9KoOR59dVDir+f1wWrso1sfj8G4lF2KrULaj1jXkKIlAs3ToGL2l19LMSUdlbL/vGI dKcJhW6lGB6B0cHK2GmG1EhsOl1cG7FatBa/r/D5OW4Y94Tbq6G0UW2qeuco2FsgbMNd 0GrHpherk77h+V4VQQgCuSBAh+n4CgCyUfbw756maFnGApbSqamTyXzTGHyvBRDCJJuU ntf3YQv0VdN5e5GlU5+nt3YT1I+voAMrCaBJSu+1fWiC/DCiW3sQxnXgxSgBpFZxc88w R8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0ar8hH53wYzV5EGYe8r+sxUlCl+f/5B2F1ztEQKsN1o=; b=hNld5NK4b0x1QkLRsyHvEZstAJGfCGDHBWMO5AQ5+PobKLSITm53k669Zqn6xZIPmw n+XGxA/X/vqbWToREChby/h4tlUzqwwzc9qO9sj1Sj1JnmWCj7N89aKejcvtY9oG1yfH bflc3kmwwU+0PGkdF4vsVkvYibPqCGKHadArh0u/Bn0GuftxEfP1p69QvJEL0JpPtw9v MPXsl1WYSRr7UXlm2HxtH0R1Tsp26lM71moTy33vSbYkPIUz8Hh8MrFNrw6a1GY2qwWd FzfVt3iI8PGWH8kxdTXnu/VBKmkzP2eQokKVP9Subx29psNmfAX98CaNl08nOzMNyB3Y rAiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=AUwfO51u; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si2698891ejr.333.2020.12.10.04.24.30; Thu, 10 Dec 2020 04:24:58 -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; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=AUwfO51u; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728720AbgLJMQy (ORCPT + 99 others); Thu, 10 Dec 2020 07:16:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388050AbgLJMQ2 (ORCPT ); Thu, 10 Dec 2020 07:16:28 -0500 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FEAC0613CF for ; Thu, 10 Dec 2020 04:16:08 -0800 (PST) Received: by mail-lf1-x141.google.com with SMTP id 23so7859434lfg.10 for ; Thu, 10 Dec 2020 04:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0ar8hH53wYzV5EGYe8r+sxUlCl+f/5B2F1ztEQKsN1o=; b=AUwfO51u4n2ZNY/p+jCIV9C7+WWCw2x3IN5oJuSbapM89leKpyPW1crbkTLx47kXPF 6Db/SCJlFb57eoPrDDv275hIkOUEhb7BQLSKEQGQpxeXSGSzb5D0EsgfnAuCM8MHApKt i996WZRjVjbBXlo3XnusoTtrKAHb7I1OWadr/chmVHDUQXzjFDe3rj6OMvSH7l1AMPbf lasBL0YaS9nRJoEW6MhRLsi+3v7CR0X0eg1n9BRxPMuTeooK2Nbf//WB/zrw43/VpgvW 3R9j0VkVKNWduT0aSW9Mz3DOqfIJY8eWmbrBcX/VZBVnAmNS0iVnbDn1rK01B5tnvLGG qOcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0ar8hH53wYzV5EGYe8r+sxUlCl+f/5B2F1ztEQKsN1o=; b=OjJoV9YWk1y85UbLAPdLgjSK1Im8ycE7Q/3uQDw9U6nJP0MrwOS0s3GE7k4J+lE8xb fsLgnstFcmYNVNx+4ZOuNm1Wghamihyzr+a4rn8vyEZ17m7WzAlFmLSPbQOb9kbnoa6j YiE7w9IWAyL5et1f1hcWdidroL/TtO0jg3ss6wQLxKt2QIiYT0ahXXQPDhQrZyCGyg32 tScZamx9TgY7bCQrJTzRujBTEKwez2Zv7vE0PyhBKcWsXpEhakgR/sEtiS8kMzuv/GJt pTbjI3K9/8QOUm87lVutMlS1M63kV9nGuNkmrsJm/dkYK/LLgLcD9wcwrKgnIe1PBDP8 3Buw== X-Gm-Message-State: AOAM533FDYHtK6e+7aUWO6GlSBoHp+oQAQCSaa+9KbpwBi3wFkgnnTph RBXfhZBn02PhGS45S77wSiRJbA== X-Received: by 2002:a05:6512:32ac:: with SMTP id q12mr2669530lfe.298.1607602567114; Thu, 10 Dec 2020 04:16:07 -0800 (PST) Received: from localhost.localdomain (89-70-221-122.dynamic.chello.pl. [89.70.221.122]) by smtp.gmail.com with ESMTPSA id j25sm496090lfh.71.2020.12.10.04.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 04:16:06 -0800 (PST) From: Lukasz Majczak To: Pierre-Louis Bossart , Liam Girdwood , Mateusz Gorski Cc: Marcin Wojtas , Radoslaw Biernacki , Alex Levin , Guenter Roeck , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Lukasz Majczak , stable@vger.kernel.org Subject: [PATCH] ASoC: Intel: Skylake: Check the kcontrol against NULL Date: Thu, 10 Dec 2020 13:14:38 +0100 Message-Id: <20201210121438.7718-1-lma@semihalf.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 -- 2.25.1