Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcc9d76b authored by Dan Carpenter's avatar Dan Carpenter Committed by Liviu Dudau
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}