Commit 1aca75fc authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Greg Kroah-Hartman

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


[ Upstream commit dc85e9a8 ]

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86fafbe4
...@@ -1600,6 +1600,7 @@ static int sm501fb_start(struct sm501fb_info *info, ...@@ -1600,6 +1600,7 @@ static int sm501fb_start(struct sm501fb_info *info,
info->fbmem = ioremap(res->start, resource_size(res)); info->fbmem = ioremap(res->start, resource_size(res));
if (info->fbmem == NULL) { if (info->fbmem == NULL) {
dev_err(dev, "cannot remap framebuffer\n"); dev_err(dev, "cannot remap framebuffer\n");
ret = -ENXIO;
goto err_mem_res; goto err_mem_res;
} }
......
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