Commit dcaefc82 authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev/deferred-io: Test smem_start for I/O memory

Test smem_start before looking up pages from its value. Return
NULL if it is unset. This will result in a SIGBUS signal.
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/20240419083331.7761-6-tzimmermann@suse.de
parent abc79a0e
......@@ -26,11 +26,11 @@
static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long offs)
{
const void *screen_buffer = info->screen_buffer;
struct page *page;
struct page *page = NULL;
if (is_vmalloc_addr(screen_buffer + offs))
page = vmalloc_to_page(screen_buffer + offs);
else
else if (info->fix.smem_start)
page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT);
return page;
......
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