]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/komeda: Off by one in komeda_fb_get_pixel_addr()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 23 Jan 2019 09:37:55 +0000 (12:37 +0300)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Wed, 30 Jan 2019 13:46:17 +0000 (13:46 +0000)
The > should be >= to avoid an off by one bug.

Fixes: c46c24bb6b11 ("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>
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c

index 4ddd5314ca23265d2babb62c1329bddc06b3677b..23ee74d4223963dfc70e8eed490948d4593457af 100644 (file)
@@ -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;
        }