Skip to contentSkip to conversation

MIPS: drivers: fix clk leak

PATCH In review Libo Chen 2 participants 2 messages May 17, 2013

Subsystems (2)
lore
Share & tools
lore

Libo Chen

author
#0 lore raw

PATCH 1/1 MIPS: drivers: fix clk leak

when gptu_r32 fail, we should put clk before return

---
 arch/mips/lantiq/xway/gptu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/mips/lantiq/xway/gptu.c +2 -0
index 9861c86..4fa577c 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Libo Chen

when gptu_r32 fail, we should put clk before return

Quoted 17 lines
---
  arch/mips/lantiq/xway/gptu.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
arch/mips/lantiq/xway/gptu.c +2 -0
index 9861c86..4fa577c 100644
@@ -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;
  	}