drm/arm: fix unintentional integer overflow on left shift
authorColin Ian King <colin.king@canonical.com>
Thu, 18 Jun 2020 10:04:00 +0000 (11:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:46 +0000 (08:23 +0200)
commit4736313a5c75f0af6ea0536def9fce037226c3a2
treebe12b040c646c97323573605d2160f22ead460ac
parent17dc46e843bb2594069803b9bce130b127bae5ae
drm/arm: fix unintentional integer overflow on left shift

[ Upstream commit 5f368ddea6fec519bdb93b5368f6a844b6ea27a6 ]

Shifting the integer value 1 is evaluated using 32-bit arithmetic
and then used in an expression that expects a long value leads to
a potential integer overflow. Fix this by using the BIT macro to
perform the shift to avoid the overflow.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors")
Signed-off-by: Colin Ian King <colin.king@canonical.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/20200618100400.11464-1-colin.king@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/arm/malidp_planes.c