drm/komeda: Off by one in komeda_fb_get_pixel_addr()
The > should be >= to avoid an off by one bug.
Fixes: c46c24bb6b ("drm/komeda: Add komeda_framebuffer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
This commit is contained in:
committed by
Liviu Dudau
parent
874cf19296
commit
dcc9d76b6d
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user