提交 aadd4148 编写于 作者: D Dan Carpenter 提交者: Sean Paul

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: db1689aa ("drm: Create a format/modifier blob")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170809111906.4rv3hzritctfktv3@mwanda
上级 b27cc7b5
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册