Skip to content

Commit

Permalink
drm/fb-helper: Fix clip rectangle height
Browse files Browse the repository at this point in the history
Computing the clip rectangle is prone to off-by-one errors when writes
happen near the end of a memory page. Point the end of the memory area
to the first trailing byte, so that (end - start) returns the area's
length.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220209161617.3553-2-tzimmermann@suse.de
  • Loading branch information
Thomas Zimmermann committed Feb 10, 2022
1 parent f5666d4 commit a3c286d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ void drm_fb_helper_deferred_io(struct fb_info *info,
max = 0;
list_for_each_entry(page, pagelist, lru) {
start = page->index << PAGE_SHIFT;
end = start + PAGE_SIZE - 1;
end = start + PAGE_SIZE;
min = min(min, start);
max = max(max, end);
}
Expand Down

0 comments on commit a3c286d

Please sign in to comment.