irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Sep 2025 08:27:45 +0000 (10:27 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 9 Sep 2025 09:51:09 +0000 (11:51 +0200)
commita186120c780e21e4cfd186a925e34f718e30de88
tree1ceb79797d0552d61e4f9127eace5bdedcd21a92
parentbfcd1fdaae92faa8cae880eb4c3aaaa60c54bf0d
irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()

Code in gicv5_its_irq_domain_alloc() has two issues:

 - it checks the wrong return value/variable when calling gicv5_alloc_lpi()

 - The cleanup code does not take previous loop iterations into account

Fix both issues at once by adding the right gicv5_alloc_lpi() variable
check and by reworking the function cleanup code to take into account
current and previous iterations.

[ lpieralisi: Reworded commit message ]

Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Link: https://lore.kernel.org/all/20250908082745.113718-4-lpieralisi@kernel.org
drivers/irqchip/irq-gic-v5-its.c