Files
kernel_xiaomi_sm8250/mm
Dennis Zhou 526972e95e percpu: do not search past bitmap when allocating an area
[ Upstream commit 8c43004af01635cc9fbb11031d070e5e0d327ef2 ]

pcpu_find_block_fit() guarantees that a fit is found within
PCPU_BITMAP_BLOCK_BITS. Iteration is used to determine the first fit as
it compares against the block's contig_hint. This can lead to
incorrectly scanning past the end of the bitmap. The behavior was okay
given the check after for bit_off >= end and the correctness of the
hints from pcpu_find_block_fit().

This patch fixes this by bounding the end offset by the number of bits
in a chunk.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-15 11:54:11 +02:00
..
2018-06-07 17:34:36 -07:00
2018-06-07 17:34:36 -07:00
2019-06-15 11:54:01 +02:00
2019-04-05 22:32:58 +02:00
2018-12-01 09:37:33 +01:00
2018-02-06 18:32:48 -08:00