summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_plane.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-08-09 14:19:06 +0300
committerSean Paul <seanpaul@chromium.org>2017-08-09 10:15:52 -0400
commitaadd41485bb227a16f964833a4fd55c091f4a729 (patch)
treeb07aa758f657e93b9877d59c2b8b296a8b69f23f /drivers/gpu/drm/drm_plane.c
parentb27cc7b5b728c62a8d7fe92c159a4d8daacd064a (diff)
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 <dan.carpenter@oracle.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170809111906.4rv3hzritctfktv3@mwanda
Diffstat (limited to 'drivers/gpu/drm/drm_plane.c')
-rw-r--r--drivers/gpu/drm/drm_plane.c2
1 files changed, 1 insertions, 1 deletions
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;
}
}