linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: drivers: fix clk leak

To: Libo Chen <clbchenlibo.chen@huawei.com>
Subject: Re: [PATCH] MIPS: drivers: fix clk leak
From: John Crispin <john@phrozen.org>
Date: Fri, 17 May 2013 11:24:00 +0200
Cc: ralf@linux-mips.org, grant.likely@linaro.org, rob.herring@calxeda.com, linux-mips@linux-mips.org, LKML <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Li Zefan <lizefan@huawei.com>
In-reply-to: <5195CC6B.1000607@huawei.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <5195CC6B.1000607@huawei.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12
On 17/05/13 08:21, Libo Chen wrote:

when gptu_r32 fail, we should put clk before return

Signed-off-by: Libo Chen<libo.chen@huawei.com>

Acked-by: John Crispin <blogic@openwrt.org>



---
  arch/mips/lantiq/xway/gptu.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

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;
        }



<Prev in Thread] Current Thread [Next in Thread>