Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp720006pxb; Tue, 5 Apr 2022 20:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyexDBhkh+JkU07tsy4XWlfr0gH6b0xVcrp7LbzprepbiYGMArp55CwyGMMCXLCWCVvy8Zb X-Received: by 2002:a17:90a:ee84:b0:1ca:c87c:1b22 with SMTP id i4-20020a17090aee8400b001cac87c1b22mr7463124pjz.178.1649214832327; Tue, 05 Apr 2022 20:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649214832; cv=none; d=google.com; s=arc-20160816; b=nygfJMxXqT5jIJBqv2kppIqOWSAYNjqfSzWka8KuaSx/PvuykBue1TGWQJ9U/W64jf kVXEWLpwo3uU1FiAUS/Fh/Eo6ByWIKChj2jpQ5FFrpnCQM7cMvD7FSTaNYPNEkJNKpyX TLp68kFZcFGVPZL7ACUF7YytkaUBlAJbdrg6sHvFxQYk28c+YvFZFX/n3iUkeZggvTDy zHZxZ1odDAvSiriY9q0B0805DIPFH73z1Mzd2jEWlZbY7gevFOK0QDrfY8bncvNCndu8 PbjLx8fPRwJoQn7jkf7iVEsGmlQhGPuyxlzzrgrRR2qqGyTwrko5DijAtoZSe62hJNy/ ttIA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m1w+PFkmM7YSIwe8BCSPwgw4x6p4SbIQaayUdHsGuS0=; b=kvnw6dR8THJu+yIvh0PVFhjC9n7JN2cAoRdk3MLRtpEd0yzP9aXNRJvr5VLgfPmuaV v2v1YxZYK56K5JImS/BknMy9gtDaFtV+V5ZEISkcntvoBD0wfiaKmSrfLdTu7sVrf3Tm XlpZyL2Ow836boBmvyRTatKpQuN9OP7f6IG/Fuy0RVESclRwGXgnkJDEE8cCjDX57otM mS2U0PFiQXH/lEnWt8qSGVFr24t8lqov9x9zl/rK4SPLoEcsp22n437Q9sRzB0RRx5t+ rNPhnFFNpBtcVYOI2CJ40n3HyT51qe35etX+Jlfuw65hGK4zbicg5K76DLcWyOLrnpGe 8Yzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=le55z87R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s20-20020a056a0008d400b004fe134d30efsi6632202pfu.104.2022.04.05.20.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=le55z87R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5D4A15F556; Tue, 5 Apr 2022 19:53:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233875AbiDEIXz (ORCPT + 99 others); Tue, 5 Apr 2022 04:23:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235517AbiDEH7s (ORCPT ); Tue, 5 Apr 2022 03:59:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C72C3BA5B; Tue, 5 Apr 2022 00:55:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4F2E7B81B90; Tue, 5 Apr 2022 07:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9FCCC340EE; Tue, 5 Apr 2022 07:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145301; bh=NN0vJIBuGCtlaQSMcjfgiwVNSGvm5zjQua0pka742AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=le55z87R5vwP54xmo3dcwYUZeqE/1dQeO3oqruoeV3elqATY82ZOjqhlYgY1dw5RJ hwSmM/9V2V6XOmMVSOgIdCvZNhPDjpFkQFwCYk19vPf+k6h+IOhjPygM+pjOVRyCxc YOP2GnK24VUjrsLqFOEiCerSql7iKGmPUy0GgCvs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 5.17 0358/1126] ASoC: codecs: rx-macro: fix accessing compander for aux Date: Tue, 5 Apr 2022 09:18:25 +0200 Message-Id: <20220405070418.136429961@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Srinivas Kandagatla [ Upstream commit 42c709c4e1ce4c136891530646c9abd5dff3524f ] 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 Link: https://lore.kernel.org/r/20220222183212.11580-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 2b272a82eabf..32e85d2e9b90 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -2039,6 +2039,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.34.1