Re: [PATCH] genirq/irqdomain: Don't try to free an interrupt that has no mapping

From: Marc Zyngier
Date: Mon Nov 30 2020 - 06:46:40 EST


On 2020-11-29 13:55, Marc Zyngier wrote:
When an interrupt allocation fails for N interrupts, it is pretty
common for the error handling code to free the same number of interrupts,
no matter how many interrupts have actually been allocated.

This may result in the domain freeing code to be unexpectedly called
for interrupts that have no mapping in that domain. Things end pretty
badly.

Instead, add some checks to irq_domain_free_irqs_hierarchy() to make
sure that we don't follow the hierarchy if no mapping exists for
a given interrupt.

Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>

A for a good measure:

Fixes: 6a6544e520abe ("genirq/irqdomain: Remove auto-recursive hierarchy support")

Thanks,

M.
--
Jazz is not dead. It just smells funny...