From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6C9DC4332F for ; Sun, 2 Oct 2022 22:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DhonECnNhulvZwm+hi0S5uUqnKVx78ERgzByonw88N0=; b=ApKgG1pyCAZ8yF oqalQnesYi13uq+2eY83jkeFfPecmsEzU7IF0ESbOrbhI6RgmTsiiBRm6aalMlZXQJ6QZgousTlEn fLcrkoxLnaMYyg+MSQlS9AKk+lPMekzwKAwjlklisgwHnM+mmTd1SgV4EgpBjihPC4cjn5pYLETrZ SHa3h+4o9uAL5+lqu7STIxEV0+E4WjJ7TJ0xZFCQpP5cUM88zd8HtSZbDK0/dCMq8p6lIZT597HT7 ipUpT1tIZ+9lMPOHcGWBWf0scr0ttzLZtiCT8iulmZ4wb5ZW2stUvQoYyd3fovPl4BajFytVaRw5O cVBNPvG1wDmOJNt1vMlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1of7pz-002pL6-39; Sun, 02 Oct 2022 22:53:31 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1of7nk-002nGz-0V for linux-arm-kernel@lists.infradead.org; Sun, 02 Oct 2022 22:51:13 +0000 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 B2C89B80D98; Sun, 2 Oct 2022 22:51:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28969C433C1; Sun, 2 Oct 2022 22:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664751069; bh=YQdDdJ2wBIObSkIQqBsYU0YvqiqEvaVtU7QUzxUfiEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0LIaY9+rWFr90MgGw42jHLE2/tnrkDtnnzoE/iLF6lBpX/D9utW3OF/aYJvtCAJL qe4UrdykE2fzFOvxd9wRxmUpdBmBxDr2ssyID9CXtvhVMxaV8cjGSiAEk5RNaQwnfC Nh3Ks+VhnWPqDdc8VVTWRJlVKXl3O2EOedOyI79ah1QyELE9chxPMWwItwQiCGcoU0 ZkpCeJwbY4SkZA/aFOlyJ58EuYyg+ideb9t3zJKr9+x4B0WhqtO2d64J7u2uIh9dQY +mocowjABk/tc5TsawISzdgbTdMIE0S/7CSgzr0k8RVXsW2McPioBg+XSKBYl3+V25 qOjw3gPLjtlQg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Swati Agarwal , Vinod Koul , Sasha Levin , michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com, lars@metafoo.de, adrianml@alumnos.upm.es, shravya.kumbham@xilinx.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 05/20] dmaengine: xilinx_dma: Fix devm_platform_ioremap_resource error handling Date: Sun, 2 Oct 2022 18:50:44 -0400 Message-Id: <20221002225100.239217-5-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221002225100.239217-1-sashal@kernel.org> References: <20221002225100.239217-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221002_155112_225012_5EF1B1E5 X-CRM114-Status: GOOD ( 15.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Swati Agarwal [ Upstream commit 91df7751eb890e970afc08f50b8f0fa5ea39e03d ] Add missing cleanup in devm_platform_ioremap_resource(). When probe fails remove dma channel resources and disable clocks in accordance with the order of resources allocated . Signed-off-by: Swati Agarwal Link: https://lore.kernel.org/r/20220817061125.4720-2-swati.agarwal@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dma.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index a4450bc95466..d3556b00a672 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -3037,9 +3037,10 @@ static int xilinx_dma_probe(struct platform_device *pdev) /* Request and map I/O memory */ xdev->regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(xdev->regs)) - return PTR_ERR(xdev->regs); - + if (IS_ERR(xdev->regs)) { + err = PTR_ERR(xdev->regs); + goto disable_clks; + } /* Retrieve the DMA engine properties from the device tree */ xdev->max_buffer_len = GENMASK(XILINX_DMA_MAX_TRANS_LEN_MAX - 1, 0); xdev->s2mm_chan_id = xdev->dma_config->max_channels / 2; @@ -3134,7 +3135,7 @@ static int xilinx_dma_probe(struct platform_device *pdev) for_each_child_of_node(node, child) { err = xilinx_dma_child_probe(xdev, child); if (err < 0) - goto disable_clks; + goto error; } if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { @@ -3169,12 +3170,12 @@ static int xilinx_dma_probe(struct platform_device *pdev) return 0; -disable_clks: - xdma_disable_allclks(xdev); error: for (i = 0; i < xdev->dma_config->max_channels; i++) if (xdev->chan[i]) xilinx_dma_chan_remove(xdev->chan[i]); +disable_clks: + xdma_disable_allclks(xdev); return err; } -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel