Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Alexandre Belloni and committed by
Stephen Boyd
a97cea2a de661d00

+2 -1
+2 -1
drivers/clk/at91/clk-system.c
··· 138 138 139 139 clk = clk_register(NULL, &sys->hw); 140 140 if (IS_ERR(clk)) { 141 - free_irq(sys->irq, sys); 141 + if (irq) 142 + free_irq(sys->irq, sys); 142 143 kfree(sys); 143 144 } 144 145