]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails
authorMagnus Damm <damm@opensource.se>
Fri, 14 Dec 2012 05:53:32 +0000 (14:53 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 13 Feb 2013 10:53:27 +0000 (19:53 +0900)
Make sure clk_put() is called in case of failure in sh_cmt_setup().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/clocksource/sh_cmt.c

index 488c14cc8dbf4848085142ca03e171ed35526b40..4b8d2962cad79134544f37e1bc6fc0e4356e0715 100644 (file)
@@ -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);