drm/komeda: Fix bit check to import to value of proper type
authorCarsten Haitzler <carsten.haitzler@arm.com>
Thu, 4 Feb 2021 13:11:02 +0000 (13:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:26 +0000 (14:47 +0200)
commit7f9757005cf5e7416f2ce6af82b788eea410dcbe
treecc7071cc0141db155f5ca871c49f6744af553e4e
parent5e8b58e27ea81b64da40b501111234a0fe3e9ee5
drm/komeda: Fix bit check to import to value of proper type

[ Upstream commit be3e477effba636ad25dcd244db264c6cd5c1f36 ]

KASAN found this problem. find_first_bit() expects to look at a
pointer pointing to a long, but we look at a u32 - this is going to be
an issue with endianness but, KSAN already flags this as out-of-bounds
stack reads. This fixes it by just importing inot a local long.

Signed-off-by: Carsten Haitzler <carsten.haitzler@arm.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201218150812.68195-1-carsten.haitzler@foss.arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/arm/display/include/malidp_utils.h
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c