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>
                        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);
                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;
                }
        }