From patchwork Thu Dec 10 14:27:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 341049 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp5686886ejs; Thu, 10 Dec 2020 06:32:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvZjiqLo+/An/R7wvYIRfjann79QDv9uPVMkfwUXjsZ1SEir5kST0brcznss/VEFuTtfW9 X-Received: by 2002:a17:906:edb2:: with SMTP id sa18mr6390490ejb.264.1607610767288; Thu, 10 Dec 2020 06:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607610767; cv=none; d=google.com; s=arc-20160816; b=dMBy9obLQiTJuC6HtWxPFvico22B/LZIEZxuOGicM7w2EpyIPgMKLI5XAAZXq/so63 tszqI9Kags8hlLE+bqR9FvEAxttWJ8Jg6fzP2sEz9cHs3ilGiprgguI5LDe3u9kiJkN5 3eMHHz2awYC3x9XkwwF53HG+I48Ljszbw5pTaKQHno+m5OaBhvorLIOWFOqBvK5qQjus QdyZPEpSnyI+tr0/mr6KVn9dxvwokJz3kUmvQW3kDwdllot3ALo0L/ZLgd2nsLk5wKzg eDOgG/rePO+IsaWh5N7y99rAB/AtNODKtWw+FNYfsI0giglYaWlsHnKNaqG9FUlr9Plz ++JA== 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=Q7YKBYEQiZBNtpwSs1yDKcwIph+lWeFlsNDyyRoorrngX1eHugTrAuqOYzKOxbj21X Hx/Ujejt+F62W5acOCoeNjF7Rayhov8uSb2lnOvHteYaRpZ32wu2PdTANKZic9C4zD64 5Y9BpqZaNZhPkyekHuKLPmpxjeSHM5lI9DUiwve3pkZ+y00ZjEhNton18k8n0EcRgbB1 QXXN/NjAYKGP1bKsdQQu3PuhhaZ8JJoLd1awHkidBWuhpgdhZTabn5NUj9MXe8/R2rm4 GOlMfG+smXXl//NjJ6RYQRWxH2k/2fEeIM3dtgCaAKQ0ZoQ/7p+UBoF6CNAtTNDc/iSM I/wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 o27si2819297edi.277.2020.12.10.06.32.47; Thu, 10 Dec 2020 06:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2390291AbgLJOcK (ORCPT + 14 others); Thu, 10 Dec 2020 09:32:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:39628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732568AbgLJOcJ (ORCPT ); Thu, 10 Dec 2020 09:32:09 -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.14 26/31] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 10 Dec 2020 15:27:03 +0100 Message-Id: <20201210142603.407895709@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.099683598@linuxfoundation.org> References: <20201210142602.099683598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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; }