From patchwork Thu Dec 10 14:27:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 341053 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5785637jai; Thu, 10 Dec 2020 10:29:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlyxBZkPtxZsjElOiJZOeMwAFtidLwsq5AtXxY0ce/QZ7AWNgTiRz3OB/8Ny4ad2uazdEA X-Received: by 2002:a05:6402:3074:: with SMTP id bs20mr8093589edb.365.1607624957470; Thu, 10 Dec 2020 10:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607624957; cv=none; d=google.com; s=arc-20160816; b=T6nmW0TmpZAP2RHxaQ2+6ZFgpHim4hnP3/J2bZMD60iO4bA+yCevuI8zICf9jP+4PR QLzQJ4HbJduXBZNAEN6UIg2WFQad8m5bfKX2hMrZHk8uIS5WHm/4rT0B9RTuxtjRrfSw lck1whBeIdd9aF1k9K9hgXrgO3YseO4oZ/14Sc+3VqcAObMesohUxY0bn083KPOum4ZR xhKJ1mhk+phR0gNYzsjuEyPchaHAw6utxnI9vS9rLVhjhd1AglzrzDYqDlA+e7D8dAkg KIPBOsYxKUBjSnhEUaxtzOelbS0ZmpKBZbMFIdBCXQcgQC7IFVgbSlABANTU1DUN8Maz 915w== 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=n3fkMFBVj1MP7x1SqWf3magqVg6naYVDesXLE5TXWdg6Cc0j7HkbFuh3YqK2VCVe8Z UHdYcTlu90CO/9L/JmmTRJmo3npyLbZ2lDpIM/QJsynLEloZIahBM0Au6Mg06fNC2FW2 HNGo8d6ylzuEzK0CqO3S3B1uTRigUC4vNflvyzJhX50AWMvQh8gzF/BbiiQm03/lrkC5 RXOcO9zNGF/iJBo9DQgO5iiZzrdWsE8nk0mb9z2RINTUEHai6vY8selkKYZhMLlcnO/L 542slhuPoe5+W/ROoly7uGhT1qjXdx6UUXzCQynmZA711N9it+BArx1uBpq8SwzWECCm UVCg== 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 ce16si3251684edb.238.2020.12.10.10.29.17; Thu, 10 Dec 2020 10:29:17 -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 S2390818AbgLJOej (ORCPT + 14 others); Thu, 10 Dec 2020 09:34:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:42610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389430AbgLJOeg (ORCPT ); Thu, 10 Dec 2020 09:34:36 -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.19 32/39] spi: bcm2835: Release the DMA channel if probe fails after dma_init Date: Thu, 10 Dec 2020 15:27:11 +0100 Message-Id: <20201210142603.859833258@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201210142602.272595094@linuxfoundation.org> References: <20201210142602.272595094@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 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; }