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

sm501fb: don't return zero on failure path in sm501fb_start()

If fbmem iomemory mapping failed, sm501fb_start() breaks off
initialization, deallocates resources, but returns zero.
As a result, double deallocation can happen in sm501fb_stop().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Alexey Khoroshilov and committed by
Bartlomiej Zolnierkiewicz
dc85e9a8 45f580c4

+1
+1
drivers/video/fbdev/sm501fb.c
··· 1600 1600 info->fbmem = ioremap(res->start, resource_size(res)); 1601 1601 if (info->fbmem == NULL) { 1602 1602 dev_err(dev, "cannot remap framebuffer\n"); 1603 + ret = -ENXIO; 1603 1604 goto err_mem_res; 1604 1605 } 1605 1606