From patchwork Tue Dec 19 16:22:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 181078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2056067dyi; Tue, 19 Dec 2023 08:24:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcD6E2YLfJeyr1l94sbU6ytinBDOaZvkPROuLnqbAb1iiIiVcmOmfvZFFzOONnlHB19Uxb X-Received: by 2002:a05:620a:66c:b0:77f:2608:d92f with SMTP id a12-20020a05620a066c00b0077f2608d92fmr18890905qkh.134.1703003090001; Tue, 19 Dec 2023 08:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703003089; cv=none; d=google.com; s=arc-20160816; b=mgXEaHHLerDG7ZX5REqhDI944pMA4DPFQ+Imoeupbjissuq7+T56Rcg6ijiNZa50tM LwoF4/5JrY6qgww6e7c7ioNH75AUEfS1RPUzgqhSxgPbM4AzVwZWBMTwhyzqm1Jnn3Om 9cQuo6dWGSt0eE8Bkq+BJ9CN3fOKOZsWS5KWDAwJtNaen1W/cNPm1A2wTzh0O8apCGMk dBhNUI/OXbwIp8brku2jll8h2bH2unfhkS6XnqjZj1otOmCBbC4yAoIybjwRMPmdq01l wdu3THLLVmDHCy5WupRS6m6GuR0G+V64X7nMMjgwn9M7eOax+LFx3qnNSFoRaYVIkf81 nOAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kWx+FOgFshuXbEEqkcUUBv5Kl1kbOKWb4xX0B875/08=; fh=CIzheBTUL5fyGH3nbQHnzCXjO4Ty5MYCLcLsWbV53xg=; b=suC/4VW0UV/M7/l0FbXsaGNMKoO3wPgmm2bplAT5YHkO5IBy7psIEYlNalFCVveMK8 No2eU4jOy44rN1e32F9+0CivtFFEsZ1vLRs3Z3pja0glZBFf+hQALHi61vtwkzhy0bhG kMausjYZc1+kHgDRxF51+g/Hqs/ETtK7oU/Idhf+G/aD3RVuaVqCRIVfWJaLTLaOsbB0 h03hu2g2Cr+dG+zc2IAUSQ8sAY0mutD/C0Yg3UFh2hyogEvw5AATn0Q2gHn/lRAePdAe +/fs/AFkhg/dfPNnTsOii90Ri0wUZbaFbkUG9lEyo+P/Vum9gwzulTKbrybZi2yCUAV0 iuLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=IIT2R+8t; spf=pass (google.com: domain of linux-kernel+bounces-5552-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5552-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id qs2-20020a05620a394200b0077d91e758d2si25235222qkn.282.2023.12.19.08.24.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 08:24:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5552-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=IIT2R+8t; spf=pass (google.com: domain of linux-kernel+bounces-5552-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5552-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C422F1C21A72 for ; Tue, 19 Dec 2023 16:24:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54A2C31A62; Tue, 19 Dec 2023 16:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="IIT2R+8t" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A8520315; Tue, 19 Dec 2023 16:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BJ6vo3A022423; Tue, 19 Dec 2023 10:22:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=kWx+FOgFshuXbEEqkcUUBv5Kl1kbOKWb4xX0B875/08=; b= IIT2R+8t3bT7OdewwNHScukbYxtUDo26JLmOO9T/Ab9SLxPlqSu+WSErFFSyKPen VJ6YdtDeQGYge5BoBoZQx1+8V54g7FQxmIwG/iXkCOChn0zKyg9VvQVE4au6TDcX jSO3e/qfvIxEjn1T3cM8d9a+qQ1b/KwZPAyS34nXbINCO+HkdslSPtfVcnOFwNv6 wZTGJdOWQKVQk8z5MjKABkiQvUQvsijpooYlTNbZ2wV3h5k7xroFEPct21vUeLAV of0afIOtumAtJBHJwcYL7l1Ls8/fAXHywuGP2rF0L8ao0k/XGsi7UJimzxX98x1h /dAjOZdDQJRY+Zpnti1xlA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3v1a6249gs-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 10:22:47 -0600 (CST) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 19 Dec 2023 16:22:43 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Tue, 19 Dec 2023 16:22:43 +0000 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.77]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 0A9A715B9; Tue, 19 Dec 2023 16:22:43 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , , "Stefan Binding" Subject: [PATCH v1 1/2] ALSA: hda: cs35l41: Do not allow uninitialised variables to be freed Date: Tue, 19 Dec 2023 16:22:31 +0000 Message-ID: <20231219162232.790358-2-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219162232.790358-1-sbinding@opensource.cirrus.com> References: <20231219162232.790358-1-sbinding@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: ODee1_Mhp9AwakRjhVnYukfjuVkbAeWJ X-Proofpoint-ORIG-GUID: ODee1_Mhp9AwakRjhVnYukfjuVkbAeWJ X-Proofpoint-Spam-Reason: safe X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785728168189146755 X-GMAIL-MSGID: 1785728168189146755 Initialise the variables to NULL so that they cannot be uninitialised when devm_kfree is called. Found by static analysis. Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda_property.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c index c9eb70290973..73b304e6c83c 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -77,10 +77,10 @@ static const struct cs35l41_config cs35l41_config_table[] = { static int cs35l41_add_gpios(struct cs35l41_hda *cs35l41, struct device *physdev, int reset_gpio, int spkid_gpio, int cs_gpio_index, int num_amps) { - struct acpi_gpio_mapping *gpio_mapping; - struct acpi_gpio_params *reset_gpio_params; - struct acpi_gpio_params *spkid_gpio_params; - struct acpi_gpio_params *cs_gpio_params; + struct acpi_gpio_mapping *gpio_mapping = NULL; + struct acpi_gpio_params *reset_gpio_params = NULL; + struct acpi_gpio_params *spkid_gpio_params = NULL; + struct acpi_gpio_params *cs_gpio_params = NULL; unsigned int num_entries = 0; unsigned int reset_index, spkid_index, csgpio_index; int i; From patchwork Tue Dec 19 16:22:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 181077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2055951dyi; Tue, 19 Dec 2023 08:24:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaglTM3taKIZ9zWhN8tPFp0awdRBaInkp6LneEe/2JMwTNmDG4IXE+/w3QoOSMjFYLcQBl X-Received: by 2002:a05:6512:aca:b0:50b:e056:396a with SMTP id n10-20020a0565120aca00b0050be056396amr10066941lfu.28.1703003078187; Tue, 19 Dec 2023 08:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703003078; cv=none; d=google.com; s=arc-20160816; b=wSx2BwqknkU75E+H/nQTD+yA4UxIAJZvXi8sP+EU2XIKBxeYMF/cbdUUP/VuKwU5Sk y5CqzkMkCVP1iuIMrcIGHV0PU8jaB3bgW9TpefSZ1ZFddZ/adv+2nfvURM/fktxhmXoY w8ul554ZvTZFcC/kEn9sc+v/n4iWpSAvB+kLU+hy2r2mDUpyemoHynFpMRx395ls1yu7 KKqrS1mPM2RoIV5/WT+pCZmw/XJ+yaWhWUwr3LDuiNW7+LMz0WPNwQwSHrXSqteFcySn tL35NcTpLrgR28WZNEb2cCD3UcEGCVvzrYJ1w1bKP2nNmtZBuYWM0Czw5otAOxp0KTod CMhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BoVaGh/eH7nGZeEelaU0i1uh/HBS9k3X4xBMik9sYek=; fh=H3Mw6n1UeURws4rS8ov/fRZAyW1iKlkS4ByHNY3u2xA=; b=aChpb9zYiyqSFNrzqRmvZ9cru9h+RYq6NuggGzQsW1uh9Qny0L7raDrra1C5281qcW CE8wWxTtSyfondMbL6uF0n0xXOewLcbF2BKVIIW7D37yyi/6VNLKx1BUfbQOpHY5FQiu AmGkjofOeiSmuRyyOQmOVTQ+bWzswY+obGPPUCf4pNp0yISDh4IY3ymwBg7fv/oRDIJ4 wZz3M02/kkqRsN1Ti7iGTe3Qe/fU0rk/NbFKgrJfZgeIn37Wydplk1TaVt1G/Aah27Th l24fDGeUXhtxDJYAgB4dHSECaCHSwajjyIELdJuyilabWEA0CaXmoz217OCvscAzRz6L Jfmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WMCIphRa; spf=pass (google.com: domain of linux-kernel+bounces-5550-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5550-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m9-20020a056402510900b0054cb9717a33si11022066edd.205.2023.12.19.08.24.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 08:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5550-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WMCIphRa; spf=pass (google.com: domain of linux-kernel+bounces-5550-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5550-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BFC0A1F25803 for ; Tue, 19 Dec 2023 16:24:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49CAB1D54B; Tue, 19 Dec 2023 16:23:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="WMCIphRa" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79AA920319; Tue, 19 Dec 2023 16:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BJ6vo3B022423; Tue, 19 Dec 2023 10:22:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=BoVaGh/eH7nGZeEelaU0i1uh/HBS9k3X4xBMik9sYek=; b= WMCIphRaeyGQRQFZZyGmYxGArGpBbrgP27CTR5/VHMj25AcWvM4YvtTF3Wsvf935 ZfZeJPYbKIZIH+enzPcKCsmWQO2MEUFvFj5pqGooSpJqDxlKLq4CiLMXbaXINekM Ebu0qAaMA6CQ8J8q/Tf/E/WOxoy/dM9P1LpYbvKhdVhl5WI5bSpjwT9YVlz1dEqm oHD2vqrDT5loHhvUyYbDFtVz1QpoC/nN3MOrajSLp0fG+6la04+/J+/S+Jc72hJ1 iBwrY+t/UR0FHDooruvX6vV+FFMn2jQiLEkCK0/NyZ9sQk8ezv0sR3UOWFAtZRF+ OpVY4TgSgRuEpPTm/CeWFw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3v1a6249gs-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Dec 2023 10:22:48 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 19 Dec 2023 16:22:43 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Tue, 19 Dec 2023 16:22:43 +0000 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.77]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 451DE11D1; Tue, 19 Dec 2023 16:22:43 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , , "Stefan Binding" , kernel test robot Subject: [PATCH v1 2/2] ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel Date: Tue, 19 Dec 2023 16:22:32 +0000 Message-ID: <20231219162232.790358-3-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219162232.790358-1-sbinding@opensource.cirrus.com> References: <20231219162232.790358-1-sbinding@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: yc_jk4S_5prVHkTVfhZhHYzieyQxFs6b X-Proofpoint-ORIG-GUID: yc_jk4S_5prVHkTVfhZhHYzieyQxFs6b X-Proofpoint-Spam-Reason: safe X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785728155927628474 X-GMAIL-MSGID: 1785728155927628474 If CONFIG_SPI is not set in the kernel, there is no point in trying to set the chip selects. We can selectively compile it. Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312192256.lJelQEoZ-lkp@intel.com/ Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda_property.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c index 73b304e6c83c..194e1179a253 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -210,6 +210,8 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde if (cfg->bus == SPI) { cs35l41->index = id; + +#if IS_ENABLED(CONFIG_SPI) /* * Manually set the Chip Select for the second amp in the node. * This is only supported for systems with 2 amps, since we cannot expand the @@ -249,6 +251,7 @@ static int generic_dsd_config(struct cs35l41_hda *cs35l41, struct device *physde spi_setup(spi); } } +#endif } else { if (cfg->num_amps > 2) /*