Commit a97cea2a authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Stephen Boyd

clk: at91: system: don't try to free_irq when there is no IRQ

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: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent de661d00
...@@ -138,7 +138,8 @@ at91_clk_register_system(struct at91_pmc *pmc, const char *name, ...@@ -138,7 +138,8 @@ at91_clk_register_system(struct at91_pmc *pmc, const char *name,
clk = clk_register(NULL, &sys->hw); clk = clk_register(NULL, &sys->hw);
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
free_irq(sys->irq, sys); if (irq)
free_irq(sys->irq, sys);
kfree(sys); kfree(sys);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment