Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp822121pxb; Wed, 6 Apr 2022 00:46:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUD4EWBEX7AmNM4rve9NeJkfYAOSxqKNujPsb2kWLiOUeEO5RWFlSrJn3ZM7B56UGdQ8we X-Received: by 2002:a05:6a00:2444:b0:4fd:db81:cbdd with SMTP id d4-20020a056a00244400b004fddb81cbddmr7711120pfj.32.1649231172189; Wed, 06 Apr 2022 00:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649231172; cv=none; d=google.com; s=arc-20160816; b=MoUrh2LIHwfGBPpANrT+7WQpg+4of8FlSAcpRY7cWxjshFbyYQ+bIvr8ruTODp2IG0 ISP7HGVMZDFvOrWFAiE2hBpPePsD/kkvu38SDQHj2ltpjOupL4A76rg09/aWdrb2XB8i fHM0cp1xuxO7ii38z+/m/ham0Ual/LGKN6IygXhhhs7yBOp6rd3V/mJ4AxXjYQ/XGOTF urG1UNZteCEXsqXw/XBRmYAiLbyh8St0Oj6EjGG8y5hNCJulGJUs06DvocZITptijCum anlheTfinsaWsMXyb3X2tnE6e085k8HaDyl9c2XwtVz5uy339DUAvsk1KjlDe/ZMStPa /SfQ== 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=ixERoudOjEYpz+vX24N+McSJoioUYaPcc/U/IC2hX1A=; b=DTQ7/klDEdK34jD/UZ8T/gh4Y2hf3P0skXINHAUT7AXmU7onkAQghwWOF6vFTb68Wq cDhJSvcQSkeZS8G7rmY3dlt4jVoa1dtiK3+unjqoDRS8rfOPjNtj5DJgxBspjCUI1nsQ hJK5hphoaVVbxTM9YXOWrT6OugBuwQBaZdiCOa7GNql1jo+1ewimrPTeXkUAopae8uEW lPoyVN4VG4zapGRzp8CBgqq8RjK/+7ThAX4lm9d8ZwyZvzQX50a/WzRxCDE9LIrx8KQv DHCj42FdSRFiQTrDIXkwdC7NV6ehIJcdE7AfcgR1VkdF74H7f9aFfs8pxVnChCtYkezl 7mvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i1atCNA2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id x185-20020a6331c2000000b003816043ef8csi15513954pgx.385.2022.04.06.00.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 00:46:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i1atCNA2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 6D69450C10D; Wed, 6 Apr 2022 00:14:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1843014AbiDFBih (ORCPT + 99 others); Tue, 5 Apr 2022 21:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348757AbiDEJsb (ORCPT ); Tue, 5 Apr 2022 05:48:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C1364BFE6; Tue, 5 Apr 2022 02:34:53 -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 04362B81B75; Tue, 5 Apr 2022 09:34:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D823C385A4; Tue, 5 Apr 2022 09:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151290; bh=rrq5DQ4s3Epa8STH7GdSx073QvvtZEtfAAz8FBiN6QM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1atCNA2C3N/2zoFBNds1hPeBQXcu42y6/L5xNK5M5ggZmNwgGRsomGQQw9bLFzXI P0CTiYZAb14pZCekT8PX1fg4SY3+x2v2Bk5tMa1oWDlbBUrzE+W10sBXHoKuURJnsV 86xnMEML+Pg2rVbXC9N8zlobuDDKK2JNruixew4c= 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.15 361/913] ASoC: dmaengine: do not use a NULL prepare_slave_config() callback Date: Tue, 5 Apr 2022 09:23:43 +0200 Message-Id: <20220405070350.666729129@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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: 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 4aa48c74f21a..38f3f36c1d72 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -82,10 +82,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