video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap
[ Upstream commit 4dcd19bfabaee8f9f4bcf203afba09b98ccbaf76 ] 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: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Yoichi Yuasa <yuasa@linux-mips.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1286e959a5
commit
93794239c6
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue