提交 2fd61b32 编写于 作者: M Magnus Damm 提交者: Simon Horman

clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails

Make sure clk_put() is called in case of failure in sh_cmt_setup().
Signed-off-by: NShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: NMagnus Damm <damm@opensource.se>
Acked-by: NJohn Stultz <john.stultz@linaro.org>
Tested-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
上级 f6161aa1
......@@ -708,17 +708,19 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
cfg->clocksource_rating);
if (ret) {
dev_err(&p->pdev->dev, "registration failed\n");
goto err1;
goto err2;
}
p->cs_enabled = false;
ret = setup_irq(irq, &p->irqaction);
if (ret) {
dev_err(&p->pdev->dev, "failed to request irq %d\n", irq);
goto err1;
goto err2;
}
return 0;
err2:
clk_put(p->clk);
err1:
iounmap(p->mapbase);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册