From: Alexandre Belloni Date: Fri, 11 Sep 2015 14:34:07 +0000 (+0200) Subject: clk: at91: system: don't try to free_irq when there is no IRQ X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a97cea2a5cfb1e66716226ea258251317acd8ffe;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-by: Boris Brezillon Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/at91/clk-system.c b/drivers/clk/at91/clk-system.c index 58008b3e8bc1..3f5314344286 100644 --- a/drivers/clk/at91/clk-system.c +++ b/drivers/clk/at91/clk-system.c @@ -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); }