X-Received: by 2002:a17:90b:388d:b0:1b8:cc1b:3360 with SMTP id mu13-20020a17090b388d00b001b8cc1b3360mr4124796pjb.56.1645535393545; Tue, 22 Feb 2022 05:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645535393; cv=none; d=google.com; s=arc-20160816; b=osFC6fP51V20LzWdUFtR+UFhqGS8B1yaDWUjku/mHFtIYXalIcdTQTmhfU2N3AACMq p9Ane7AxAKPecwxGqiZszybz3lquxV2QzQOc1kDnXeZ+Wpt5X7NtdRpSVtIqL00eGmEv xxLKnXUZd8S6eqQ2vMhmn7ZfZ8ySHBu8tOPlmvyq+G6gAkfbIIDuKPohCE0xFraLDuzS aH4MVvkXDT6218F7q53+Vn3Ye90uoFlQfOTr1jD4V2sljrBG8/7+58eDa1HXM1VmfEqi r11xnkrG7yzNZD/xjyRc0vZcpP7mHnKpCwVZ46VjMILP7jns5KkT5pFqDtFhAlXdwcOg Pshg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HYM5KhvV8cAY2xeJWd0M65Y2tn1Q2u3N1GUicP98cl8=; b=h3WeESAtW+ukxcJfnuOACEKZDfnWg/iw4FisKXaIJrjbip/wTkkwvzm4h8sfM3AJ3f tvEeejICqRHn1GG4sB6LvtNNdEMvK01t8sD6A5ocnk5biCSqqpZ8GpEupRNqWwHhsx0s f0fAUMA61eZEph/osolKe/3TWGl6OFq8MmCnnSkOZCzoQx4aPMS7CE+DMbYtZ2ggpCDX W1MLvax3BkTtkU4kO5btx9Q2qj2mx3oXvdDasWsJQCglYi8hbU0vOhs7dlebdrvDgXbd AShqGUudW41f4zcEkOulheJxRg8FKTqispdlmbfuOQ1Owk7LvRSbvwGBGbvkzi66oSmV uMvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RX6X4lmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a17090aaa9100b001b8c4823b45si1905552pjq.107.2022.02.22.05.09.37; Tue, 22 Feb 2022 05:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RX6X4lmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231809AbiBVMA0 (ORCPT + 99 others); Tue, 22 Feb 2022 07:00:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbiBVMAP (ORCPT ); Tue, 22 Feb 2022 07:00:15 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF440156C60 for ; Tue, 22 Feb 2022 03:59:49 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id o62-20020a1ca541000000b00380e3cc26b7so225887wme.0 for ; Tue, 22 Feb 2022 03:59:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HYM5KhvV8cAY2xeJWd0M65Y2tn1Q2u3N1GUicP98cl8=; b=RX6X4lmjUY/h74tOHBTweptlgfLuFmBZXV8kDh2RmGzLeHzQ1u8tX6ZCvYEtccu4xQ HDE9G6MNBk9HNR+SajG7pQzZdjFm0r67Nunqg/UVJnUCN2CbZpLjLDUlDFZtZnYjNzfq Z3zwno2Ykj4Sld3+FXEO0uOwjcVctBiD0cvjfm+O/+WywJgfmbAUvej5JRLmwvqJ7EN4 S2oaW8N4IX+XJtROIFJSlARsVfqzcBW/5U0cHVTULCTgfbDMCB6hJt54sDFM+Z4ws3WN 4fY5UycCJvCdpNSsRatWPKCJ/qwZILJzH9jmJPjjVdWjuXBA7FDNZsZ8FLGwGLK3M9E+ mzhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HYM5KhvV8cAY2xeJWd0M65Y2tn1Q2u3N1GUicP98cl8=; b=m6VWIiWBkdaj5Ao/F1dUYkYmYOLSw052QlY6QIZNheDNWveCGPCGr1j96kjUWsGfVM Y6Pc7PTQA13G3z9RulRfmuDLq3BOuxzBsID6RgwWThDUF41JSkWMoi7re6ULERPg//Is FR+yrWNHRQGNf62zGChxhPFjEFBiOMoFHcEAUIp70ZU8P5APczKo1IA/3n9V/l/Pcm3A taS5ioMQjIQl4hUbA1WDVOJX1cs2D3VDDATDUTGMhAHP5nIj+MZPPVjHkZlbrd2DqoNB Wwx8f05nM0Tq7IW6Ppcq2IiY4gWZ7uhRgnk+PtmNnQdi1MR4/R+VZbhelIANdZ3f9bmi Qn4A== X-Gm-Message-State: AOAM530/lqllCjbpMJZatVrEla8nLMtuwSPfufngpEULgVqh3ZnCtR5C M1DAbMcO1mJerxudx1D+N//Dqg== X-Received: by 2002:a05:600c:2e02:b0:380:d7dc:5530 with SMTP id o2-20020a05600c2e0200b00380d7dc5530mr1856598wmf.115.1645531188467; Tue, 22 Feb 2022 03:59:48 -0800 (PST) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id a18sm50014661wrg.13.2022.02.22.03.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 03:59:48 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, quic_srivasam@quicinc.com, Srinivas Kandagatla Subject: [PATCH 01/16] ASoC: codecs: rx-macro: fix accessing compander for aux Date: Tue, 22 Feb 2022 11:59:18 +0000 Message-Id: <20220222115933.9114-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220222115933.9114-1-srinivas.kandagatla@linaro.org> References: <20220222115933.9114-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AUX interpolator does not have compander, so check before accessing compander data for this. Without this checkan array of out bounds access will be made in comp_enabled[] array. Fixes: 4f692926f562 ("ASoC: codecs: lpass-rx-macro: add dapm widgets and route") Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/lpass-rx-macro.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index fadf3c99c89d..a7f86b094a4f 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -2040,6 +2040,10 @@ static int rx_macro_load_compander_coeff(struct snd_soc_component *component, int i; int hph_pwr_mode; + /* AUX does not have compander */ + if (comp == INTERP_AUX) + return 0; + if (!rx->comp_enabled[comp]) return 0; -- 2.21.0