Re: [PATCH] irqchip/gic-v3-its: Fix double free on error

From: huangguanrui.hgr
Date: Thu Mar 21 2024 - 22:38:33 EST


We notice that:
In its_vpe_irq_domain_alloc, its_vm is from args, But in its_vpe_irq_domain_free,
its_vm is from domain->host_data.

Will these two values be different? For example, when other bugs occur?
If these two values is different, I think we can't handle these 2 cases together.

if (err)
its_vpe_irq_domain_free(domain, virq, i);
Because these will lead a memleak.

So I think that check the bitmap is a safe way to fix this. If bitmap is empty, that means
its_vpe_irq_domain_free handles same its_vm which comes from its_vpe_irq_domain_alloc.

Thanks,
Guanrui