[PATCH v4 3/6] irqchip/gic-v3-its: Fix leak in its_vpe_irq_domain_alloc()

Marc Zyngier maz at kernel.org
Thu Jul 2 15:12:57 PDT 2026


On Thu, 02 Jul 2026 04:30:47 +0100,
Kemeng Shi <shikemeng at huaweicloud.com> wrote:
> 
> When its_irq_gic_domain_alloc() fails, the following
> its_vpe_irq_domain_free() skips calling its_vep_teardown() for the
> corresponding irq. Call its_vpe_teardown() when its_irq_gic_domain_alloc()
> is failedto avoid the leak issue.
> 
> Fixes: 7d75bbb4bc1ad ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown")
> Signed-off-by: Kemeng Shi <shikemeng at huaweicloud.com>
> ---
>  drivers/irqchip/irq-gic-v3-its.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 3e4edcb64065..8968bedefdba 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -4666,8 +4666,10 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
>  			break;
>  		err = its_irq_gic_domain_alloc(domain, virq + i,
>  					       vm->vpes[i]->vpe_db_lpi);
> -		if (err)
> +		if (err) {
> +			its_vpe_teardown(vm->vpes[i]);
>  			break;
> +		}

There is already a spot for error handling in this function, we don't
need a second one.

	M.

-- 
Jazz isn't dead. It just smells funny.



More information about the linux-arm-kernel mailing list