Commit 9de0a4e3 authored by Arvind Yadav's avatar Arvind Yadav Committed by Sasha Levin

video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap

[ Upstream commit 4dcd19bf ]

Here, If devm_ioremap will fail. It will return NULL.
Kernel can run into a NULL-pointer dereference.
This error check will avoid NULL pointer dereference.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: default avatarYoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent ba30f042
......@@ -350,6 +350,11 @@ static int cobalt_lcdfb_probe(struct platform_device *dev)
info->screen_size = resource_size(res);
info->screen_base = devm_ioremap(&dev->dev, res->start,
info->screen_size);
if (!info->screen_base) {
framebuffer_release(info);
return -ENOMEM;
}
info->fbops = &cobalt_lcd_fbops;
info->fix = cobalt_lcdfb_fix;
info->fix.smem_start = res->start;
......
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