From patchwork Sun Dec 6 12:39:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 338822 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1985785jai; Sun, 6 Dec 2020 04:41:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxlEiPWvKMQp6yA8r3uZOuDnkqXw1DlNKcWBzRfcRMb5zz/OHpUdajvFCNtmhQ2mEmZ2jX X-Received: by 2002:a17:906:5293:: with SMTP id c19mr14986052ejm.72.1607258468777; Sun, 06 Dec 2020 04:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607258468; cv=none; d=google.com; s=arc-20160816; b=04RlPlAebWhj+W4014onShXf8tfpRsKmb+pyHweXJ/PVIkrnVXo1bHVZmAbEWSIssm vSLcVQbp92FvMoQD0I+KMnhJjoB8GhDRzTyA+pyH9nXh5Bi78GgIOvYOaEqT73Csqg39 qwTE6m5FLdi2GHc5ikS87cQBZ2x+cjZlg0GiMnNUEs3CNjO1beYiDnUIbfOfIKoQ3DMd LT9kAz/pp0ghyhzYla/jQSieS+P2oOIFm13WlcqvHd/1vOX0ZiJmRb75amlh4FNnQLy6 qM7IXmemhLnLcNCuzMzpJn6wzODNwtd1xhHYz1YcyrEmug189K68g7jw6mdX9WFd10TM rZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:date:from:references:in-reply-to :message-id; bh=ndUFc2sOqAQMbnSCT7CmPDuq/IUBQh9hDOdlRJEcl9o=; b=H/rv3mUhDeJuHbjR3r0Imd9d+/fyWC0wQTyhUxKBCHEcPY/Oei+pl6wY3ksall80qV pZLoBqwANGMPKxNVfe4+g26hBw0TfRQILGL6wAkmXlHcGzOvZjRAb7kgWC5Dae01OK7D I+qT2/j25CY9Lcu4aplt3ByjSuZSabhzForo543GTgxWSXZwUS6WWjkGeXBaHaM6c5G5 gfqWG6qccKmphmNDhs1fRkWeXgApH4bwlbQAxszqskXA46mzghl/YQM59G6L5JaKKizV Cd/G61v8NXn/tiIqj+KdFEQ2k0gEFzudMteL0ctMmYVQ2T61q6Hm5JHIdFyXPXDBKtLv NSUg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si5798310ejx.183.2020.12.06.04.41.08; Sun, 06 Dec 2020 04:41:08 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727838AbgLFMlI (ORCPT + 14 others); Sun, 6 Dec 2020 07:41:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgLFMlI (ORCPT ); Sun, 6 Dec 2020 07:41:08 -0500 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f236:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB2CAC0613D2 for ; Sun, 6 Dec 2020 04:40:27 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout3.hostsharing.net (Postfix) with ESMTPS id BE697101E692D; Sun, 6 Dec 2020 13:40:25 +0100 (CET) Received: from localhost (unknown [89.246.108.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 6227E6040B59; Sun, 6 Dec 2020 13:40:26 +0100 (CET) X-Mailbox-Line: From a24a3f238fb7c048e0be57d197ef39ce75b8a9ca Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <4a3ce9b0ebf2883bc24595f444723f5dee555c3d.1607258208.git.lukas@wunner.de> References: <4a3ce9b0ebf2883bc24595f444723f5dee555c3d.1607258208.git.lukas@wunner.de> From: Lukas Wunner Date: Sun, 6 Dec 2020 13:39:04 +0100 Subject: [PATCH 4.14-stable 5/5] spi: bcm2835: Release the DMA channel if probe fails after dma_init To: Greg Kroah-Hartman Cc: Mark Brown , Sudip Mukherjee , stable@vger.kernel.org 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 --- drivers/spi/spi-bcm2835.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.29.2 diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 2908df35466f..6824beae18e4 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -787,18 +787,19 @@ static int bcm2835_spi_probe(struct platform_device *pdev) 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; }