Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666846pxb; Tue, 5 Apr 2022 18:00:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX+SXh4dh8LTP6C6iq1IRAN/K4zeQfRj15//kQgp1iWj2/7/SJTIwtanQQadbbh3vT4gdG X-Received: by 2002:aa7:db94:0:b0:410:f0e8:c39e with SMTP id u20-20020aa7db94000000b00410f0e8c39emr6127082edt.14.1649206801536; Tue, 05 Apr 2022 18:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206801; cv=none; d=google.com; s=arc-20160816; b=U1lBAc9hzM9Ejj2YnBpclcLVziMrd6g98b+yQgekTpXk3r+UYmBMMxcWD2dTQeYUYF TqgyO2ISP50JFLC6Hv2qxHmZgqliXLKdJWcDWB5FWitS1Ra+Lvnegh5U2fWWmXWiW94x nsdke36LhODklby2uBNghb32jnGAx7BN5yFSFQbcxG0fJFPe4o+VDt3rPtwUTQukebEH QFU3qNMOGJsg9LbmHkFRFWzLgnPdit/NNrMOz+b8sW/Bs0XbCFax5h8mg7HLoUNnQ3J5 fvjo+Z5TmJI6b7Uu3ULmfOCUcGm7I/iXGvB+f/ClGOhZjSotzi/RE6QRKzGSWG0D7Xzf A5pA== 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=kJe55V7lPkVJvxqdSgeKtGwq4j83/OAx0wcgM/+dSSA=; b=sCo7quo95PUKo8PD7ksPn3HEz0FVAEouRmGeNK9h19kjRxEo6mRWM6p0EnnXg/Y0Hv TnfTdiGdRZ7sHSHQGQ964G/djPNTRXAxoF9DJtqxs3Wj8GFwBA4ScR+eR8wM22j9sD7v L6UABLgsEW9JGzy894AUE2AEZ6Uw2k6o8Dvb+dkFBgEGYUGFez4BIwS/t/hUl4iCkeKX kgoutSg4iwl45rG8yZ8L9YHsG5WcKm4548nsdnTDsPgNd3CDkLrE8BYjhJhWJ7oFHfta dqbeOeuZJPYPhtkrMSNQsD/x6B7QRN7Zmb7dMT6/5afJR3DsU2+Z5XPrty5pPzPMIHnU atzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="E/soCuPv"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a509d0e000000b00418e504da93si11367226ede.361.2022.04.05.17.59.36; Tue, 05 Apr 2022 18:00:01 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b="E/soCuPv"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237982AbiDEISg (ORCPT + 99 others); Tue, 5 Apr 2022 04:18:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235670AbiDEH77 (ORCPT ); Tue, 5 Apr 2022 03:59:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D751A83A; Tue, 5 Apr 2022 00:57:23 -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 7C014B81B18; Tue, 5 Apr 2022 07:57:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C80BFC340EE; Tue, 5 Apr 2022 07:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145441; bh=c5hPHAtu+iRvo8QtoMFfl/ahmvxhhouRZErc52MWFNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/soCuPvmLYq0w7ou/ud/eDXu8dfA3BYrVTDZ+uTs5bC8L5OOguOVHIqRop0hZ8+Z BR47JMj7/Nq5Fb/J1xSx7rs3u90RY/a+/4jIWrx9oCgXKdMzG2fb4ry55fVsdPhZl6 OHinzxhE1xLw0DM6OctnDHypZS5PXhuKEPLffHfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Codrin Ciubotariu , Mark Brown , Sasha Levin Subject: [PATCH 5.17 0406/1126] ASoC: dmaengine: do not use a NULL prepare_slave_config() callback Date: Tue, 5 Apr 2022 09:19:13 +0200 Message-Id: <20220405070419.542855395@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Codrin Ciubotariu [ Upstream commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4 ] Even if struct snd_dmaengine_pcm_config is used, prepare_slave_config() callback might not be set. Check if this callback is set before using it. Fixes: fa654e085300 ("ASoC: dmaengine-pcm: Provide default config") Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220307122202.2251639-2-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-generic-dmaengine-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index c54c8ca8d715..359987bf76d1 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, memset(&slave_config, 0, sizeof(slave_config)); - if (!pcm->config) - prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; - else + if (pcm->config && pcm->config->prepare_slave_config) prepare_slave_config = pcm->config->prepare_slave_config; + else + prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; if (prepare_slave_config) { int ret = prepare_slave_config(substream, params, &slave_config); -- 2.34.1