From patchwork Thu Jan 21 17:16:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 12037221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 198DAC433DB for ; Thu, 21 Jan 2021 17:18:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 623B523A57 for ; Thu, 21 Jan 2021 17:18:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 623B523A57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9E36718F9; Thu, 21 Jan 2021 18:17:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9E36718F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1611249522; bh=rsNzeOtWALehmeSa1wgwOzvO744l+gKaieiyjD0LmHo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BlemhiteVUY+kT8dV3LwliMPyrFSWScvH674wOLWFHeKdVLVlcntJioMoAkOSlnJ1 CgQ/gJHQkYLcnfGGhxoXN3VaHW+YpDaNv9CPqzHDM768g8TGFGMn5kN+hbuDngkJaC WTU8aQZ8qgtssXoeinbsO4LoHelKM8wrLojDzjs8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 04FFBF80273; Thu, 21 Jan 2021 18:16:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 163AEF80257; Thu, 21 Jan 2021 18:16:55 +0100 (CET) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AF107F80164 for ; Thu, 21 Jan 2021 18:16:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF107F80164 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CWn25tIi" Received: by mail-ej1-x632.google.com with SMTP id r12so3680766ejb.9 for ; Thu, 21 Jan 2021 09:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R37OwwWmnd3gx+4QWJQscKseQ469mdd6BDRuEqSONlc=; b=CWn25tIicWFL5R/EoP0Lw4d3jigOs6L3lg+H8SEmtOHGMseHtmldYRKeFKZ4IZZPFI FbX562x4NKV151mntW0uUcYzfQm7qac71gge153zpsQH6FIr5EtA5YBEBr412WLSwoFP ucz1a79Zr9a8/QFF/N0/vZt2L6smCUZGQAxi0= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=R37OwwWmnd3gx+4QWJQscKseQ469mdd6BDRuEqSONlc=; b=nfPBI+/liWmxKtq9akesHrTXNo1m652MMCC4FVh8JoplLrSwR+uFPLpsN8RadAUDFT au6DZEkmUZZxXsZqSTbTICf+BeBfoI1C52MTjf7rPmby0/Ru+8JylnMGzgAeaicvGpcz rtO+YwE0DIQB2gGFnAc0dBTCUva4tF21y64x6G3Dwhd5GFxnA4zYi23ipX5w5FFTRi35 abjP+TYVi5mYqVQp4EuLWF0Vz4MIxqeNEcx7RaITrozID3nQA044PH3ZTBluosx34gbr 6dd5FoslQKcDYAfjeNmUWPjFtrrwpw5uXqRzyzTK33E92RyfwBvjmzAvIR0eQPAF/hGN G1Gw== X-Gm-Message-State: AOAM530HA7Ne48ddAMErkf2x/QM/wg/X95Q+3Rc2EGI2y+Jb0TcP98G2 WCmXf0+D1lEvQ9b+WlJe+GFgeg== X-Google-Smtp-Source: ABdhPJy+x6N7BHDOHH5vuQVEJdyydy2XancBgQi0eaeXii6q/njzBaQIRBAtjMRzAtrBnRx1Lvo4BA== X-Received: by 2002:a17:906:eb12:: with SMTP id mb18mr309753ejb.257.1611249407746; Thu, 21 Jan 2021 09:16:47 -0800 (PST) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id q9sm2484024ejd.113.2021.01.21.09.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 09:16:47 -0800 (PST) From: Ricardo Ribalda To: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , Mateusz Gorski , Andy Shevchenko , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Lukasz Majczak Subject: [PATCH v2 2/2] ASoC: Intel: Skylake: Zero snd_ctl_elem_value Date: Thu, 21 Jan 2021 18:16:44 +0100 Message-Id: <20210121171644.131059-2-ribalda@chromium.org> X-Mailer: git-send-email 2.30.0.296.g2bfb1c46d8-goog In-Reply-To: <20210121171644.131059-1-ribalda@chromium.org> References: <20210121171644.131059-1-ribalda@chromium.org> MIME-Version: 1.0 Cc: Ricardo Ribalda X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Clear struct snd_ctl_elem_value before calling ->put() to avoid any data leak. Signed-off-by: Ricardo Ribalda Reviewed-by: Cezary Rojewski Reviewed-by: Andy Shevchenko --- sound/soc/intel/skylake/skl-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 1ef30ca45410..b824086203b9 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3632,7 +3632,7 @@ static void skl_tplg_complete(struct snd_soc_component *component) sprintf(chan_text, "c%d", mach->mach_params.dmic_num); for (i = 0; i < se->items; i++) { - struct snd_ctl_elem_value val; + struct snd_ctl_elem_value val = {}; if (strstr(texts[i], chan_text)) { val.value.enumerated.item[0] = i;