diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-04-19 10:28:58 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2024-05-02 11:33:14 +0200 |
commit | dcaefc82395841fa15aa70a2c8841cda4f87125f (patch) | |
tree | 5d2e740a21d5a4bc678e5205aa4772cf9b1f6d2a /drivers/video | |
parent | fbdev/deferred-io: Test screen_buffer for vmalloc'ed memory (diff) | |
download | linux-dcaefc82395841fa15aa70a2c8841cda4f87125f.tar.xz linux-dcaefc82395841fa15aa70a2c8841cda4f87125f.zip |
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: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240419083331.7761-6-tzimmermann@suse.de
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/core/fb_defio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index 45e8708eb223..37910753759c 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -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; |