summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKaige Fu <kaige.fu@linux.alibaba.com>2021-09-15 10:20:55 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-30 10:09:24 +0200
commit42d3711c23781045e7a5cd28536c774b9a66d20b (patch)
tree7cd15edde496af304be6fd6c7bc1f5c57caa2596 /drivers
parent71f323f6059218b7ab14bbe43b8f155033c176ce (diff)
downloadlinux-stable-42d3711c23781045e7a5cd28536c774b9a66d20b.tar.gz
linux-stable-42d3711c23781045e7a5cd28536c774b9a66d20b.tar.bz2
linux-stable-42d3711c23781045e7a5cd28536c774b9a66d20b.zip
irqchip/gic-v3-its: Fix potential VPE leak on error
[ Upstream commit 280bef512933b2dda01d681d8cbe499b98fc5bdd ] In its_vpe_irq_domain_alloc, when its_vpe_init() returns an error, there is an off-by-one in the number of VPEs to be freed. Fix it by simply passing the number of VPEs allocated, which is the index of the loop iterating over the VPEs. Fixes: 7d75bbb4bc1a ("irqchip/gic-v3-its: Add VPE irq domain allocation/teardown") Signed-off-by: Kaige Fu <kaige.fu@linux.alibaba.com> [maz: fixed commit message] Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/d9e36dee512e63670287ed9eff884a5d8d6d27f2.1631672311.git.kaige.fu@linux.alibaba.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index f298313b87ac..398c54387988 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3123,7 +3123,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);