From: Dmitry Osipenko Date: Mon, 3 Jun 2019 18:59:43 +0000 (+0300) Subject: clocksource/drivers/tegra: Release all IRQ's on request_irq() error X-Git-Tag: v5.2.3~247 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8f7bce8f064f3a0822fbafa7c23885e1e544bf0c;p=users%2Fdwmw2%2Flinux.git clocksource/drivers/tegra: Release all IRQ's on request_irq() error [ Upstream commit 7a3916706e858ad0bc3b5629c68168e1449de26a ] Release all requested IRQ's on the request error to properly clean up allocated resources. Signed-off-by: Dmitry Osipenko Acked-By: Peter De Schrijver Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- diff --git a/drivers/clocksource/timer-tegra20.c b/drivers/clocksource/timer-tegra20.c index 1e7ece2797304..fe5cc0963ac91 100644 --- a/drivers/clocksource/timer-tegra20.c +++ b/drivers/clocksource/timer-tegra20.c @@ -288,7 +288,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); @@ -298,7 +298,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; } }