Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: fbtft: core: set smem_len before fb_deferred_io_init call

The fbtft_framebuffer_alloc() calls fb_deferred_io_init() before
initializing info->fix.smem_len. It is set to zero by the
framebuffer_alloc() function. It will trigger a WARN_ON() at the
start of fb_deferred_io_init() and the function will not do anything.

Fixes: 856082f021a2 ("fbdev: defio: fix the pagelist corruption")
Signed-off-by: Peter Suti <peter.suti@streamunlimited.com>
Link: https://lore.kernel.org/r/20220727073550.1491126-1-peter.suti@streamunlimited.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peter Suti and committed by
Greg Kroah-Hartman
81e87888 2b5002e2

+1 -1
+1 -1
drivers/staging/fbtft/fbtft-core.c
··· 654 654 fbdefio->delay = HZ / fps; 655 655 fbdefio->sort_pagereflist = true; 656 656 fbdefio->deferred_io = fbtft_deferred_io; 657 - fb_deferred_io_init(info); 658 657 659 658 snprintf(info->fix.id, sizeof(info->fix.id), "%s", dev->driver->name); 660 659 info->fix.type = FB_TYPE_PACKED_PIXELS; ··· 664 665 info->fix.line_length = width * bpp / 8; 665 666 info->fix.accel = FB_ACCEL_NONE; 666 667 info->fix.smem_len = vmem_size; 668 + fb_deferred_io_init(info); 667 669 668 670 info->var.rotate = pdata->rotate; 669 671 info->var.xres = width;