Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp35619pxu; Thu, 10 Dec 2020 17:28:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaH756zvwAes1RxAx4ixi/shKDXESjLV6IsaDOpF47ym3Nb0q4cp+Nmg4NmXSZxOxoREXQ X-Received: by 2002:a50:d646:: with SMTP id c6mr9470286edj.177.1607650096443; Thu, 10 Dec 2020 17:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607650096; cv=none; d=google.com; s=arc-20160816; b=W2F3eJxzRsnZldICJHKUrb1ddYNf6ImcElWrmLNdNoxyeEfYJS8hA8Sk9YtOsFLPb0 9np7iL8r1JfpgMBLJJWTVg49Y5vXuVLM8mDoMwjgsuK85Lda8eoDM+tZZ3C+0SodKPnj E3dp/BDrTlaHTGXQ+0d27HdAB4AIF4QBuiGEsNeumNh73LX9Y7or2VsgSHY6ktz+9zLq rXa+Zp+br23oXfmtKlX7bARTo3MNx0x6yBCbPAeSzZR8UxokhV0xp2grCeIwrbq13PEU epXVEOID/B296Tv1fkGxR93rZDl5rQpf0aVGfS6AYi/o9g+tz+u0cZ/uWX35jpKlC099 OJuA== 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=GCJw90kPelMQC02WHy18MA7Y4+Ddqd5TOAZRdYuvmGlBIPzkFF9ohcpdzFZvxdruKi RC0WCPrBtv3LVh/+p+0tTRMEjzNl/T3HJ9Rq0G9pY17md9mDpbpTrKBL+eQS5JozNUKb KVdXlDLKhnYuN6yJmxeiEuRlAY+Ekto0HKrlzdX8sJ+X4d/ciYPxcMIe/vFViss8nHaN 4fpG4Lo05mdm/wJsHkWAjSn4Q4HezWWk/2LSwqbvu8dp1m+k7a1bXiDTj29d0M3lVkLi UO01WI6JRbQJIf08odzXt/5KGOlEbZxbBdzi+ank6uY4HdkBgqRpojl/odQdti256Hi5 FqkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 k8si3930210edv.134.2020.12.10.17.27.50; Thu, 10 Dec 2020 17:28:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S2390541AbgLJOcL (ORCPT + 99 others); Thu, 10 Dec 2020 09:32:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:38622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733026AbgLJOaj (ORCPT ); Thu, 10 Dec 2020 09:30:39 -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.9 40/45] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 10 Dec 2020 15:26:54 +0100 Message-Id: <20201210142604.326645697@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.361598591@linuxfoundation.org> References: <20201210142602.361598591@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; }