lkml.org 
[lkml]   [2021]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] irqchip/gic-v3-its: Fix potential vpe leak
From
Date
Ping ...

在 2021/9/15 上午10:20, Kaige Fu 写道:
> In its_vpe_irq_domain_alloc, when there is error calling its_vpe_init
> with vm->vpes[i], it says that the number of vpes which has been
> initialized are 'i'. So, the correct value passed to
> its_vpe_irq_domain_free should be 'i' instead of 'i - 1' because
> its_vpe_irq_domain_free takes nr_irqs as its third parameter.
>
> If we pass the 'i - 1' to its_vpe_irq_domain_free, the vpe[i - 1] will
> be leaked. This patch fixes it.
>
> Fixes: 7d75bbb4bc1a ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown")
> Signed-off-by: Kaige Fu <kaige.fu@linux.alibaba.com>
> ---
> drivers/irqchip/irq-gic-v3-its.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 7f40dca8cda5..eb0882d15366 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -4501,7 +4501,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
>
> if (err) {
> if (i > 0)
> - its_vpe_irq_domain_free(domain, virq, i - 1);
> + its_vpe_irq_domain_free(domain, virq, i);
>
> its_lpi_free(bitmap, base, nr_ids);
> its_free_prop_table(vprop_page);
>

\
 
 \ /
  Last update: 2021-09-22 03:19    [W:2.698 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site