]> Git Repo - linux.git/commitdiff
drm/komeda: Off by one in komeda_fb_get_pixel_addr()
authorDan Carpenter <[email protected]>
Wed, 23 Jan 2019 09:37:55 +0000 (12:37 +0300)
committerLiviu Dudau <[email protected]>
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 <[email protected]>
Reviewed-by: James Qian Wang (Arm Technology China) <[email protected]>
Signed-off-by: Liviu Dudau <[email protected]>
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;
        }
This page took 0.062057 seconds and 4 git commands to generate.