diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2019-03-12 20:33:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-27 08:14:40 +0300 |
commit | aacf2cc814c2dc45494945c4c485abe8699a3a50 (patch) | |
tree | de5b2bd70e1a2c4645dd66ea517f69ad513e11ce | |
parent | daaeeca918e726bda1681a34196437819821bc7f (diff) | |
download | linux-aacf2cc814c2dc45494945c4c485abe8699a3a50.tar.xz |
irqchip/gic-v3-its: Fix comparison logic in lpi_range_cmp
commit 89dc891792c2e046b030f87600109c22209da32e upstream.
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: 880cb3cddd16 (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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 2 |
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 78970cdf2ef6..65ab2c80529c 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1477,7 +1477,7 @@ static int lpi_range_cmp(void *priv, struct list_head *a, struct list_head *b) ra = container_of(a, struct lpi_range, entry); rb = container_of(b, struct lpi_range, entry); - return rb->base_id - ra->base_id; + return ra->base_id - rb->base_id; } static void merge_lpi_ranges(void) |