Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2205853iof; Tue, 7 Jun 2022 23:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyptPWSVYa65VjFJlTGraoJfo6Gyo6YQ6FR+Rr9nIZ3sRcu4pOCoMbbf4gbJwyTKpBEmKKl X-Received: by 2002:a17:902:cec5:b0:166:3418:5260 with SMTP id d5-20020a170902cec500b0016634185260mr32458065plg.129.1654668635470; Tue, 07 Jun 2022 23:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668635; cv=none; d=google.com; s=arc-20160816; b=NJG5jYZDzWtnT1E2me02wOkKczo3QKgV/FrK6iRMjQPgYGZzd78nPk0GAtkBSIph6j +AoKxH44sJEjWLCxQlSCfbU/PDDt4x8aFdPlQ6WewDZ/Xz9NIZ2Mc/ysBlO/FyjnHyaK jirhxscI6D8kNzdTVGlpiNljNKVu4vtB5vywC1lxtEWOvU18ocn4KngAlUUqSmeDlpK3 QfMUpqqvXfjLhtIR/TBo652RBhBZPP/cDX19/hEsJ0mD6Js82buxPTWPpbZRMCbQESWe X0ke354svVK9rsTIgXeueT1Oxdiub0IwtgHqksrnJJV24tY2HA2rQnmvaAI5AFF/AqZy JrqA== 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=XLrLI4FH4XXbamO62deFIXn1MvEbBxQOEj0/bY0RISY=; b=uuNs0B0cCi7uVB4hOcOx4ob87XWU8WWwntHkZ33qL5XRgDP2oRgrn4XgeJ/Rp73R8a rzg93mUfgLaucaHh7noeuuPAro5s65hFjet4sgy6VnBEM/x6t/XTRED93a6HlbYlLXHp gaRbAshWlv0/Y2X6R07/1yAMnNlZxGev55Mx+Hjxf5Aga5YSsyo55DJGRWbQeG/d7pWu JwSzsrY59wPJbeDW4Q8fqaSz1f+T3vp0FHxFhpRZrEXey3HezrmfKAkvj4usZXDR5+py LAbM3F6ItrNw82t7Q+6Ju7U/W6vDYHyHrHLOgqR9nYsIVwRymEhPkicZGaVkGlhqFPel YdhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m1nYXAvT; 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 o17-20020a639211000000b003fa4c5f1a23si28702829pgd.253.2022.06.07.23.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:10:35 -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=m1nYXAvT; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1251C1673C7; Tue, 7 Jun 2022 22:32:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391394AbiFHAiE (ORCPT + 99 others); Tue, 7 Jun 2022 20:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382352AbiFGV52 (ORCPT ); Tue, 7 Jun 2022 17:57:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48E0E24CCB9; Tue, 7 Jun 2022 12:13:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 18E866187F; Tue, 7 Jun 2022 19:13:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BF02C385A2; Tue, 7 Jun 2022 19:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629230; bh=fYt44UOFqp6bVHmHKUIZ+rPvfcZUcC0CBE2g6h/djF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m1nYXAvT1FfYhkOrUoUo538oMQrHCoaHh4Cd9WkxG4aWEZhgAbfO5tqiFFJpPqOrr 59adb124HevwOpx5c/MTByPelYg8FwjNVG0yC4hHTb1s4lO1dCDNeEVAKOALnDc9GR dfR7NftGAfjF32yBI1jLaXkao7KxxnbfjZDtUWMQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Lad Prabhakar , Mark Brown , Sasha Levin Subject: [PATCH 5.18 589/879] ASoC: sh: rz-ssi: Release the DMA channels in rz_ssi_probe() error path Date: Tue, 7 Jun 2022 19:01:47 +0200 Message-Id: <20220607165019.948640754@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 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=unavailable 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: Lad Prabhakar [ Upstream commit 767e6f26204d3f5406630e86b720d01818b8616d ] DMA channels requested by rz_ssi_dma_request() in rz_ssi_probe() were never released in the error path apart from one place. This patch fixes this issue by calling rz_ssi_release_dma_channels() in the error path. Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220426074922.13319-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rz-ssi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index 8bbcebbe7e73..8a0c01ca06be 100644 --- a/sound/soc/sh/rz-ssi.c +++ b/sound/soc/sh/rz-ssi.c @@ -978,14 +978,18 @@ static int rz_ssi_probe(struct platform_device *pdev) /* Error Interrupt */ ssi->irq_int = platform_get_irq_byname(pdev, "int_req"); - if (ssi->irq_int < 0) + if (ssi->irq_int < 0) { + rz_ssi_release_dma_channels(ssi); return ssi->irq_int; + } ret = devm_request_irq(&pdev->dev, ssi->irq_int, &rz_ssi_interrupt, 0, dev_name(&pdev->dev), ssi); - if (ret < 0) + if (ret < 0) { + rz_ssi_release_dma_channels(ssi); return dev_err_probe(&pdev->dev, ret, "irq request error (int_req)\n"); + } if (!rz_ssi_is_dma_enabled(ssi)) { /* Tx and Rx interrupts (pio only) */ @@ -1013,13 +1017,16 @@ static int rz_ssi_probe(struct platform_device *pdev) } ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); - if (IS_ERR(ssi->rstc)) + if (IS_ERR(ssi->rstc)) { + rz_ssi_release_dma_channels(ssi); return PTR_ERR(ssi->rstc); + } reset_control_deassert(ssi->rstc); pm_runtime_enable(&pdev->dev); ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) { + rz_ssi_release_dma_channels(ssi); pm_runtime_disable(ssi->dev); reset_control_assert(ssi->rstc); return dev_err_probe(ssi->dev, ret, "pm_runtime_resume_and_get failed\n"); -- 2.35.1