irqchip/gic-v3-its: Fix comparison logic in lpi_range_cmp
commit70c1b15faf8b1885a89072d959869cd22a7bfafb
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 12 Mar 2019 17:33:46 +0000 (12 18:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2019 05:17:55 +0000 (27 14:17 +0900)
treeae09de5d8907f2ca8c4638b2d012480b40b19765
parentdfa011546d27afb6c189261b5fb78db0bf9f44f3
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>
drivers/irqchip/irq-gic-v3-its.c