]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:43 +0000 (09:12 +0200)
[ Upstream commit 7a3916706e858ad0bc3b5629c68168e1449de26a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-tegra20.c

index fdb3d795a409aa2565aa48ec0650127766d3e054..cc18bb135a1779f76e14a7ae9efe50287c25578f 100644 (file)
@@ -310,7 +310,7 @@ static int __init tegra_init_timer(struct device_node *np)
                        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);
@@ -320,7 +320,8 @@ static int __init tegra_init_timer(struct device_node *np)
                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;
                }
        }