提交 dcc9d76b 编写于 作者: D Dan Carpenter 提交者: Liviu Dudau

drm/komeda: Off by one in komeda_fb_get_pixel_addr()

The > should be >= to avoid an off by one bug.

Fixes: c46c24bb ("drm/komeda: Add komeda_framebuffer")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NJames Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
上级 874cf192
......@@ -144,7 +144,7 @@ komeda_fb_get_pixel_addr(struct komeda_fb *kfb, int x, int y, int plane)
const struct drm_gem_cma_object *obj;
u32 plane_x, plane_y, cpp, pitch, offset;
if (plane > fb->format->num_planes) {
if (plane >= fb->format->num_planes) {
DRM_DEBUG_KMS("Out of max plane num.\n");
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册