Do nothing if kmap_local_page_try_from_panic() returns NULL. This is not likely to hapen, as the previous page from the same memory area has been mapped successfully.
Signed-off-by: Thomas Zimmermann <[email protected]> Fixes: 23437509a694 ("drm/panic: Fix 24bit pixel crossing page boundaries") Cc: Javier Martinez Canillas <[email protected]> Cc: Jocelyn Falempe <[email protected]> Cc: [email protected] Cc: <[email protected]> # v6.18+ --- drivers/gpu/drm/drm_panic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index ba21df4be338..d28ce8878e05 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -178,6 +178,8 @@ static void drm_panic_write_pixel24_xpage(void *vaddr, struct page *next_page, u8 *p = vaddr + offset; vaddr2 = kmap_local_page_try_from_panic(next_page); + if (!vaddr2) + return; *p++ = color & 0xff; color >>= 8; -- 2.55.0
