Commit dcc9d76b authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJames Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
parent 874cf192
...@@ -144,7 +144,7 @@ komeda_fb_get_pixel_addr(struct komeda_fb *kfb, int x, int y, int plane) ...@@ -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; const struct drm_gem_cma_object *obj;
u32 plane_x, plane_y, cpp, pitch, offset; 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"); DRM_DEBUG_KMS("Out of max plane num.\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment