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

From: Zenghui Yu
Date: Tue Mar 26 2024 - 05:47:30 EST


On 2024/3/22 10:38, huangguanrui.hgr wrote:
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.

They *should* point to the same its_vm structure.

Will these two values be different? For example, when other bugs occur?

Of course they can be different if there are *bugs* but I guess you
won't get any further (e.g., you hit BUG_ON(vm != vpe->its_vm) in
its_vpe_irq_domain_free()). The right thing to do is fixing the bug
rather than papering over it.

Zenghui