Return-Path: Received: from mail-sn1nam02on0108.outbound.protection.outlook.com ([104.47.36.108]:20937 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032494AbeCAPhg (ORCPT ); Thu, 1 Mar 2018 10:37:36 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Tobias Jordan , Vinod Koul , Sasha Levin Subject: [added to the 4.1 stable tree] dmaengine: jz4740: disable/unprepare clk if probe fails Date: Thu, 1 Mar 2018 15:27:01 +0000 Message-ID: <20180301152116.1486-422-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Tobias Jordan This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit eb9436966fdc84cebdf222952a99898ab46d9bb0 ] in error path of jz4740_dma_probe(), call clk_disable_unprepare() to clean up. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 25ce6c35fea0 MIPS: jz4740: Remove custom DMA API Signed-off-by: Tobias Jordan Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/dma-jz4740.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c index 7638b24ce8d0..35fc58f4bf4b 100644 --- a/drivers/dma/dma-jz4740.c +++ b/drivers/dma/dma-jz4740.c @@ -557,7 +557,7 @@ static int jz4740_dma_probe(struct platform_device *pde= v) =20 ret =3D dma_async_device_register(dd); if (ret) - return ret; + goto err_clk; =20 irq =3D platform_get_irq(pdev, 0); ret =3D request_irq(irq, jz4740_dma_irq, 0, dev_name(&pdev->dev), dmadev)= ; @@ -570,6 +570,8 @@ static int jz4740_dma_probe(struct platform_device *pde= v) =20 err_unregister: dma_async_device_unregister(dd); +err_clk: + clk_disable_unprepare(dmadev->clk); return ret; } =20 --=20 2.14.1