From patchwork Sun Dec 6 12:31: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: 338821 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1985303jai; Sun, 6 Dec 2020 04:40:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUPH2ryi7BnQKOZCsI8XPYeYgYqM/PQjq9SjKbF30AJF7F/ENwTYEArM0HcD2M+OdFEEWA X-Received: by 2002:a05:6402:ca1:: with SMTP id cn1mr6715731edb.128.1607258411939; Sun, 06 Dec 2020 04:40:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607258411; cv=none; d=google.com; s=arc-20160816; b=Zyja8T3Utf1zMUSmnIU0eldMWAXzv1Xc734Lqvi4ZtOhDiEZHkIlWzSoU7pE04KgGl reWQtEbw+xMawEPMrDQW/3sD4rqiQNZihOIhTImmp/I/UlyuQw8Ry2tAYIsIYLCz11nJ zsdP29+X9TOgzgCy7AVF3wXcK5uOvFeCQ8NJwuPA0au2wG1cW4tWWfUegCuGd46q4B3X ZoPhScvqDwz0l1doVgrpbYoHjvVax04MY08zNcWC3rdGjCbeSR0FwiQgeRvQSv/BQDyJ sfzKjYG8GovEHMe/39tj12G4SAkOT99o8rQAPfqZFr0S2BtJcOFuFFD65n8Ym4BmxXki 3Omw== 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=qE9Ubajy+DPwcsTHPraoJcXi22UJYyqYZ7nlcVD16ddCjj1/kWKdnMx8ggu0JIcR01 9WwshEQ0nlmtAiJAfbmSFmmBdTlwuhtlzUl0sDBwY8QFRD0lFAXKPf2hSR2VXTxIbJ51 nh4pdDrSCO7paySL9WiaeLHfN69zh8Sdk4qSm/jvHbWZf8wOAm2VE6dqTKPSmOAwbS1x O0elI0nwK1R0zUsrzhTZNwh2VGqYi9ppX0Hdk/oC0v/1bUqgzq3XX+VzLpDN68/MzKrc 9dNGvJ1a492Cu4K6hyYX/+yrQVRqUAOlc5h+UaT/FTnMbHL70QVt2X356dbey4vZu6+s G7Xg== 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.40.11; Sun, 06 Dec 2020 04:40:11 -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 S1726076AbgLFMkL (ORCPT + 14 others); Sun, 6 Dec 2020 07:40:11 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:37851 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgLFMkL (ORCPT ); Sun, 6 Dec 2020 07:40:11 -0500 X-Greylist: delayed 471 seconds by postgrey-1.27 at vger.kernel.org; Sun, 06 Dec 2020 07:40:10 EST Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (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 4AF69100A8780; Sun, 6 Dec 2020 13:31:56 +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 CE2BB6040B59; Sun, 6 Dec 2020 13:31:56 +0100 (CET) X-Mailbox-Line: From a8bee87930a86d39aded59970c4d808692df4f45 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <70e63c9a7ed172e15b9d1fe82d44603ea9c76288.1607257456.git.lukas@wunner.de> References: <70e63c9a7ed172e15b9d1fe82d44603ea9c76288.1607257456.git.lukas@wunner.de> From: Lukas Wunner Date: Sun, 6 Dec 2020 13:31:04 +0100 Subject: [PATCH 4.19-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; }