Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp163806pxu; Thu, 10 Dec 2020 22:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJys337fA78PtG45KNQHzVQMkbPhsBTiDtNwymddHwhVcfU+d5hV/4OYBcS/QgmBlbB9BwlA X-Received: by 2002:a17:906:b104:: with SMTP id u4mr9439777ejy.121.1607667237348; Thu, 10 Dec 2020 22:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607667237; cv=none; d=google.com; s=arc-20160816; b=0xMnrmlWf4F7cqPb9krY07fvGSG63gPtuhzFfycPjJkTWriAQplEtuiNk89YuJwfdV LoBBd4gUCpJ93q1+Kzm3fe4pmhzBBwkOheIXI5+qnBeVl6rOjNxxrSnkJN4lm/Z7w6Ib 8AD67s0jCp7kLFlNt0X7oAYnF1CTqm3xJRprlp5MkU3X1YGZPH6IPEpuSvRFQu2B1K2a oh031H1Q0SfYWKVJ4ZTwucV0aOBHKp8ba0PA486MlqI3IldgZQZPm7OyTkiFHHRLcEuL CGGuLpWTPPsyhaIWFof0MbVmsNvT6RYqjHLHywJU1OXJ/KsZeAaOQdQ4vsFHhbraz9Pg Jq5A== 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; bh=6D88s7DOWyjGVir7vZez2w/UN7xbSnSwumjfPeDTvdg=; b=KXO0B3cqZOA4frvbPQjF22Mosz28lCalb2xavYNUZRk7eNf8jra/zBFVk7s+6h6fgY 0VMNVT/6MNoNUk7qV5VGOHjQ9KdofaS4DfP8+/JsByIRl/nx4FaFjp9l53GGNElW/q3V L3Wu3p+e2M8LWdyAqrJXBPDIC2B0vmQk26zojEH9UQeqA5UMRHMoZRZRjTC37vaaPU2/ J/Ljn0kYeNCwbplIa2KhNNIOcEKF7+RsEZcBhMxFGyWnBwKS9wUsmMSW4iXFuLxODdHu AiZssOoYF/2h4TIGy2ESQSQUG7B5LYUfqjbjDQwNAsCL41qS/ZoJqLrRXfYdY07zTbQ8 2i8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si4069481eda.301.2020.12.10.22.13.22; Thu, 10 Dec 2020 22:13:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391147AbgLJOiV (ORCPT + 99 others); Thu, 10 Dec 2020 09:38:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:42610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389430AbgLJOeg (ORCPT ); Thu, 10 Dec 2020 09:34:36 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Nicolas Saenz Julienne , Mark Brown , Lukas Wunner Subject: [PATCH 4.19 32/39] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 10 Dec 2020 15:27:11 +0100 Message-Id: <20201210142603.859833258@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.272595094@linuxfoundation.org> References: <20201210142602.272595094@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Ujfalusi [ Upstream commit 666224b43b4bd4612ce3b758c038f9bc5c5e3fcb ] The DMA channel was not released if either devm_request_irq() or devm_spi_register_controller() failed. Signed-off-by: Peter Ujfalusi Reviewed-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20191212135550.4634-3-peter.ujfalusi@ti.com Signed-off-by: Mark Brown [lukas: backport to 4.19-stable] Signed-off-by: Lukas Wunner Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-bcm2835.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -787,18 +787,19 @@ static int bcm2835_spi_probe(struct plat dev_name(&pdev->dev), master); if (err) { dev_err(&pdev->dev, "could not request IRQ: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } err = spi_register_master(master); if (err) { dev_err(&pdev->dev, "could not register SPI master: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } return 0; -out_clk_disable: +out_dma_release: + bcm2835_dma_release(master); clk_disable_unprepare(bs->clk); return err; }