From patchwork Sun Dec 6 13:10:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 338825 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2003344jai; Sun, 6 Dec 2020 05:12:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaXBjuQnRwjRdiebAJnSh2Bpq/Nsxc0XB8d7P2u9O9Ck1Og8/8f5YyYULi/lE+YnQ/jjiC X-Received: by 2002:aa7:d846:: with SMTP id f6mr15762524eds.55.1607260336277; Sun, 06 Dec 2020 05:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607260336; cv=none; d=google.com; s=arc-20160816; b=Jdf1RKDm2VvKhybW4giH8jr7DgzZS1qXj9HcNLiSuUKk0omybGneXePiM/0SpsWSiz BPfzxEDDvpBNLHtellvuX6C/UPj8sznodhkc5NfJ73BoLGvrkaoT56OmI6gZuxHvrv/H /XN+rbWqB85inwnzuUQ+7XguWdnnd2SbR3RvbeS7QI+a0w9L+yi4pOoNUz3dMYE46QDb PYW3Gppcqo36I4XuNvL4c0nAABvm4EFBHeJ2yUMzlR5nfAj9BeZEDRdcQ2TZO2SACZpC /f9ElDsltyn/yXOaC9DJeSEFQjQNLEVE9KiPUtFE79WO9clAfWvbs8F7ZrjSs/3LSp/p 2rIA== 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:message-id; bh=M1MTm8sldiF8ibXR+DD8OLFrd7qeV7sr9vJmbnIkASs=; b=O6K9JP70laHNgiD8UPD7D+U75go17gt14+rdinoz7ZAx8qaYV1wasIT9gP+NNbxf9g z+2o6LQeKO5ZMnaQfe1QFn0UMBMZFzK5po+vBeEIMPYeRBidJgXBXHcoEcAmzw6loJ3M mqhKNRants2eISVzKpY+aLlXIno5TYLriXoX3h3HVyEwOQbAYR2N0InS23qIWinR8wxw Ney5Ws3TKaZbOzXBOW5EB0qax6CxqS7/+C5oB+82wZGyti7K2X9QO2KA2mfVzNTQ09Ut Kd/6ueiU08J6L6aCemOZ7C+Hqa8J0bhpP7ck6WvItHcl6gZADCkMKQKPWag8ljBH4+VJ vY3g== 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 x2si4807597ejd.604.2020.12.06.05.12.15; Sun, 06 Dec 2020 05:12:16 -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 S1727326AbgLFNKs (ORCPT + 14 others); Sun, 6 Dec 2020 08:10:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgLFNKs (ORCPT ); Sun, 6 Dec 2020 08:10:48 -0500 Received: from mailout1.hostsharing.net (mailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5fcc:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E42C0613D0 for ; Sun, 6 Dec 2020 05:10:07 -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 mailout1.hostsharing.net (Postfix) with ESMTPS id C242510138A00; Sun, 6 Dec 2020 14:09:29 +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 6224460144BE; Sun, 6 Dec 2020 14:10:06 +0100 (CET) X-Mailbox-Line: From 298055a3252640ac67dbf1dbf1452678133fa515 Mon Sep 17 00:00:00 2001 Message-Id: <298055a3252640ac67dbf1dbf1452678133fa515.1607260117.git.lukas@wunner.de> From: Lukas Wunner Date: Sun, 6 Dec 2020 14:10:00 +0100 Subject: [PATCH 5.4-stable] 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 5.4-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 5bc97b22491c..56ee84e85bee 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1310,21 +1310,22 @@ static int bcm2835_spi_probe(struct platform_device *pdev) dev_name(&pdev->dev), ctlr); if (err) { dev_err(&pdev->dev, "could not request IRQ: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } err = spi_register_controller(ctlr); if (err) { dev_err(&pdev->dev, "could not register SPI controller: %d\n", err); - goto out_clk_disable; + goto out_dma_release; } bcm2835_debugfs_create(bs, dev_name(&pdev->dev)); return 0; -out_clk_disable: +out_dma_release: + bcm2835_dma_release(ctlr, bs); clk_disable_unprepare(bs->clk); return err; }