irqchip/ti-sci-intr: Fix freeing of irqs
authorLokesh Vutla <lokeshvutla@ti.com>
Mon, 2 Nov 2020 12:06:31 +0000 (17:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:50 +0000 (11:53 +0100)
commit1ce041fad2418efd45140c575e6e3d00ca87e5d7
tree18e331062dee0ab2215762fca711c2782c6e7322
parent629d6ba81ff29834cae9a4743b0fb2b9debad1e6
irqchip/ti-sci-intr: Fix freeing of irqs

[ Upstream commit fc6c7cd3878641fd43189f15697e7ad0871f5c1a ]

ti_sci_intr_irq_domain_free() assumes that out_irq of intr is stored in
data->chip_data and uses it for calling ti_sci irq_free() and then
mark the out_irq as available resource. But ti_sci_intr_irq_domain_alloc()
is storing p_hwirq(parent's hardware irq) which is translated from out_irq.
This is causing resource leakage and eventually out_irq resources might
be exhausted. Fix ti_sci_intr_irq_domain_alloc() by storing the out_irq
in data->chip_data.

Fixes: a5b659bd4bc7 ("irqchip/ti-sci-intr: Add support for INTR being a parent to INTR")
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20201102120631.11165-1-lokeshvutla@ti.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/irq-ti-sci-intr.c