Skip to content

Commit 89dc891

Browse files
VillemoesMarc Zyngier
authored andcommitted
irqchip/gic-v3-its: Fix comparison logic in lpi_range_cmp
The lpi_range_list is supposed to be sorted in ascending order of ->base_id (at least if the range merging is to work), but the current comparison function returns a positive value if rb->base_id > ra->base_id, which means that list_sort() will put A after B in that case - and vice versa, of course. Fixes: 880cb3c (irqchip/gic-v3-its: Refactor LPI allocator) Cc: stable@vger.kernel.org (v4.19+) Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent b41fdc4 commit 89dc891

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ static int lpi_range_cmp(void *priv, struct list_head *a, struct list_head *b)
14761476
ra = container_of(a, struct lpi_range, entry);
14771477
rb = container_of(b, struct lpi_range, entry);
14781478

1479-
return rb->base_id - ra->base_id;
1479+
return ra->base_id - rb->base_id;
14801480
}
14811481

14821482
static void merge_lpi_ranges(void)

0 commit comments

Comments
 (0)