From patchwork Thu Dec 10 14:27:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 341051 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5708810jai; Thu, 10 Dec 2020 09:00:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYbNHFN9EzpYGupcXZT8jlFLzlhKiWBnGiQ3PcbGvEmO60JkUEJLZtBWj/ETE2m05nvDm5 X-Received: by 2002:aa7:c049:: with SMTP id k9mr7689729edo.49.1607619646349; Thu, 10 Dec 2020 09:00:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607619646; cv=none; d=google.com; s=arc-20160816; b=CK1Hn101G8tHE6Yt/qjFVsjhDjx8FEKodqgvdSCUMupgc63WF0viyHkzAi6B4V/lfD wwZB76Wr6rbl9jCeLiZFL3yX0he6z/C0G4zGmDqGHBMgv2V6iCVrNsCCcOF1/zQVnfaC c3o6DeFSWs001txjuGS17359RK+xlqeC/tGdkIFibbOc4RHqWH3Z4qrKkXrk6qVcoW4y hEsDaliBIdYkt9z2bLOfguCMw+pa/YjQ/H+vm1l+DCooErpRREIq23ZXzTkuzT4Zpb0Y K6DVt77lm0XjaGCJ7bWo7xPb6dx3kae0//WAbcxpero08kmZWjYgxgykZUA18DKItus5 xXsQ== 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=CyExQfbYOrgfDcArT8vhdqN6du5cb+2XIjmURqyhyXY=; b=G9ko7Z8V+hllbFKpmxB6pzYoVkSlUgyoJWgei+ndT1ymR2b2L8ZLC+vcUfZckuOqve 6ugNDUwOTHTDlj6YvNexf9ycYeIRcW84inDTieLqUaOLCj/lxO6wDHkl3asudIsCmmhS wjbhBV6zHVsWg1FlKC+mYzdWi6QMvphZAX0Las8976w5CVOh3oCx/Z+B5uZELG6SDsGp aESqta8rEGB695mjje7aohtb1tst4j6l9wyfiztFlKhT/UwFAEWgdZddzQVph3SSu3sq PhhFXtk5EmvZPDkbobyElq30zjNdjui9bWa7kYew/a8wV6oMqqJb6Xi2y9b2bXYdO7It AbMQ== 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 w13si2835788ejn.15.2020.12.10.09.00.46; Thu, 10 Dec 2020 09:00:46 -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 S1731173AbgLJRAf (ORCPT + 14 others); Thu, 10 Dec 2020 12:00:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:43650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730417AbgLJOgM (ORCPT ); Thu, 10 Dec 2020 09:36:12 -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 5.4 39/54] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 10 Dec 2020 15:27:16 +0100 Message-Id: <20201210142603.957582556@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.037095225@linuxfoundation.org> References: <20201210142602.037095225@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 5.4-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 @@ -1310,21 +1310,22 @@ static int bcm2835_spi_probe(struct plat 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; }