From: Dan Carpenter Date: Wed, 9 Aug 2017 11:19:06 +0000 (+0300) Subject: drm: Shift wrap bug in create_in_format_blob() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aadd41485bb227a16f964833a4fd55c091f4a729;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Shift wrap bug in create_in_format_blob() "plane->format_count" can go up to 64. (It's capped in drm_universal_plane_init().) So we should be using ULL type instead of int here to prevent shift wrapping. Fixes: db1689aa61bd ("drm: Create a format/modifier blob") Signed-off-by: Dan Carpenter Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20170809111906.4rv3hzritctfktv3@mwanda --- diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 5c14beee52ff..85ab1eec73e5 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -126,7 +126,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane plane->format_types[j], plane->modifiers[i])) { - mod->formats |= 1 << j; + mod->formats |= 1ULL << j; } }