From bda97ed39b075e8ac125d4af7cdf60ca19449a16 Mon Sep 17 00:00:00 2001 From: Libo Chen Date: Fri, 17 May 2013 05:21:31 +0000 Subject: [PATCH] MIPS: Xway: Fix clk leak When gptu_r32 fails, we should put clk before returning. Signed-off-by: Libo Chen Acked-by: John Crispin Cc: grant.likely@linaro.org Cc: rob.herring@calxeda.com, Cc: linux-mips@linux-mips.org Cc: LKML linux-kernel@vger.kernel.org Cc: Andrew Morton akpm@linux-foundation.org Cc: Li Zefan lizefan@huawei.com Patchwork: https://patchwork.linux-mips.org/patch/5247/ Signed-off-by: Ralf Baechle --- arch/mips/lantiq/xway/gptu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c index 9861c86..4fa577c 100644 --- a/arch/mips/lantiq/xway/gptu.c +++ b/arch/mips/lantiq/xway/gptu.c @@ -169,6 +169,8 @@ static int gptu_probe(struct platform_device *pdev) if (((gptu_r32(GPTU_ID) >> 8) & 0xff) != GPTU_MAGIC) { dev_err(&pdev->dev, "Failed to find magic\n"); gptu_hwexit(); + clk_disable(clk); + clk_put(clk); return -ENAVAIL; } -- 2.7.4