clocksource/drivers/tegra: Release all IRQ's on request_irq() error
authorDmitry Osipenko <digetx@gmail.com>
Mon, 3 Jun 2019 18:59:43 +0000 (21:59 +0300)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 25 Jun 2019 17:49:18 +0000 (19:49 +0200)
Release all requested IRQ's on the request error to properly clean up
allocated resources.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/timer-tegra20.c

index 276b55f6ada0f3e828adecb788562499943bd84c..e2ef6b8211a560204886c2a3f6a21010d685da5b 100644 (file)
@@ -284,7 +284,7 @@ static int __init tegra_init_timer(struct device_node *np, bool tegra20)
                        pr_err("%s: can't map IRQ for CPU%d\n",
                               __func__, cpu);
                        ret = -EINVAL;
-                       goto out;
+                       goto out_irq;
                }
 
                irq_set_status_flags(cpu_to->clkevt.irq, IRQ_NOAUTOEN);
@@ -294,7 +294,8 @@ static int __init tegra_init_timer(struct device_node *np, bool tegra20)
                if (ret) {
                        pr_err("%s: cannot setup irq %d for CPU%d\n",
                                __func__, cpu_to->clkevt.irq, cpu);
-                       ret = -EINVAL;
+                       irq_dispose_mapping(cpu_to->clkevt.irq);
+                       cpu_to->clkevt.irq = 0;
                        goto out_irq;
                }
        }