Commit a3c286dc authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/fb-helper: Fix clip rectangle height

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220209161617.3553-2-tzimmermann@suse.de
parent f5666d48
...@@ -699,7 +699,7 @@ void drm_fb_helper_deferred_io(struct fb_info *info, ...@@ -699,7 +699,7 @@ void drm_fb_helper_deferred_io(struct fb_info *info,
max = 0; max = 0;
list_for_each_entry(page, pagelist, lru) { list_for_each_entry(page, pagelist, lru) {
start = page->index << PAGE_SHIFT; start = page->index << PAGE_SHIFT;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE;
min = min(min, start); min = min(min, start);
max = max(max, end); max = max(max, end);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment