]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
irqchip/gic-v5: Fix loop in gicv5_its_create_itt_two_level() cleanup path
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Sep 2025 08:27:44 +0000 (10:27 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 9 Sep 2025 09:51:09 +0000 (11:51 +0200)
The "i" variable in gicv5_its_create_itt_two_level() needs to be signed
otherwise it can cause a forever loop in the function's cleanup path.

[ 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-3-lpieralisi@kernel.org
drivers/irqchip/irq-gic-v5-its.c

index 81d813cd8fbbe91fd5952cc2099fca6ed0c8b917..dcdf8bc0864c5eb8593828bd3f2c94d2c1e5b9d8 100644 (file)
@@ -191,9 +191,9 @@ static int gicv5_its_create_itt_two_level(struct gicv5_its_chip_data *its,
                                          unsigned int num_events)
 {
        unsigned int l1_bits, l2_bits, span, events_per_l2_table;
-       unsigned int i, complete_tables, final_span, num_ents;
+       unsigned int complete_tables, final_span, num_ents;
        __le64 *itt_l1, *itt_l2, **l2ptrs;
-       int ret;
+       int i, ret;
        u64 val;
 
        ret = gicv5_its_l2sz_to_l2_bits(itt_l2sz);