clk: at91: system: don't try to free_irq when there is no IRQ
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Fri, 11 Sep 2015 14:34:07 +0000 (16:34 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 16 Sep 2015 22:22:22 +0000 (15:22 -0700)
In the error path of at91_clk_register_system(), sys->irq is freed
unconditionally but it may not exist or be request at all.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/at91/clk-system.c

index 58008b3e8bc175f8befb8126e99e5f55c57d2176..3f5314344286e3335ec77f9c02360cb75c19cb93 100644 (file)
@@ -138,7 +138,8 @@ at91_clk_register_system(struct at91_pmc *pmc, const char *name,
 
        clk = clk_register(NULL, &sys->hw);
        if (IS_ERR(clk)) {
-               free_irq(sys->irq, sys);
+               if (irq)
+                       free_irq(sys->irq, sys);
                kfree(sys);
        }