Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp907438pxb; Wed, 6 Apr 2022 03:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKhmss7wtjVB5hh02J0ffmdTEGkKAX7oCQAVMURmBmfO0HvN6WMvq2rE91bzFUWwN/lZqm X-Received: by 2002:a65:568b:0:b0:378:86b8:9426 with SMTP id v11-20020a65568b000000b0037886b89426mr6501917pgs.70.1649242677482; Wed, 06 Apr 2022 03:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649242677; cv=none; d=google.com; s=arc-20160816; b=fZLufv96yD9EIinrDevYQCyIq/y0lm2ZUaurAQhQ1Z6K94h11vhyFrAAsibSUhAFZQ MbcoCdQE+GDL4dNCczowX9ug6rfIyUj0v9l5XUocmVWv3xaEcg1moqZLS/M4xbRzPNq5 6CjcCVmhUSvqBAs1PJN6VBVabyRnZitAuczhzuceB5EKFMzgrfJ4ZqDKxdp2Qr4rlS9P sC1iZwSMOdAhiTc643U0HuMbYN8ydaVtPlmndfkbJl3e0ZInzxDvgPoATZ3nqt0TBX9s xL+n6/qwE2iDbpD4NifVa0l7tJ4ua/aim8zIjrduGqbhvw+ZEpvqX2W2mK5dJWnI9a2f 372Q== 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=c/XrcowTb/gKo3Q8gcfqJ5GNBkAdYwkzpoWQaOIPzoU=; b=RhsnUJYkDDn/CR753MGSHO0VY6B/uegLpLrx9VtjR5Qu7aaT9Hth6/4j+FyIAKmxPJ nb2+oQVNVBaRoI9LISodnafnESD6Y+fFstkDEOPtbUfErs6gJ4UR5BOcc055U+XKkQRQ DYR8W7H7du1cHUwAXOJTbRFq/auWESxbgWXmqtb63t3y8ingpfUmtrbLVwutDYnrxMbn SVrM8q7e8QWIDKn3T+AIg78nZnvK8JrYqgIOUBYUK76qGY21rdz8qjs2Tuonw6fwPBsm gvYLRyV4GrjfH38aMbIuMFPO9GmxQKbZxi1ypFXLHXtcXE5mnUYW7fvb1LIRBJiSi1jD YqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TujV6WY+; 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 bv2-20020a17090af18200b001c70d2622bbsi4301591pjb.109.2022.04.06.03.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 03:57:57 -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=TujV6WY+; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B37BA5AE2EA; Wed, 6 Apr 2022 02:16:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388398AbiDFBPr (ORCPT + 99 others); Tue, 5 Apr 2022 21:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358044AbiDEK15 (ORCPT ); Tue, 5 Apr 2022 06:27:57 -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 9454D1EAC4; Tue, 5 Apr 2022 03:13:43 -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 5414EB81C6C; Tue, 5 Apr 2022 10:13:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 969E8C385A3; Tue, 5 Apr 2022 10:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153621; bh=WXc5P+FY+yKKru4/Q8dltm0MIfbYvaCJM1bU2dmzG2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TujV6WY+/oFlGexysw6s76BLaLZhoB+P6wtZYkL+4MI5DDIGzA2PyJSowVlnIlqhV qUdjPWNv1ZVbmprthDQpyDYONqbHR61RuB7zHv0E2CuOTmW3iCVGtEplECM/a7rW0O b4RsppMWJgNCbtjrK/AbBBJFnd24haf/SAFItaSk= 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.10 249/599] ASoC: dmaengine: do not use a NULL prepare_slave_config() callback Date: Tue, 5 Apr 2022 09:29:03 +0200 Message-Id: <20220405070306.249870526@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@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 9ef80a48707e..0d100b4e43f7 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -83,10 +83,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) { ret = prepare_slave_config(substream, params, &slave_config); -- 2.34.1