Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93794239 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman
Browse files

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: 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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1286e959
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -350,6 +350,11 @@ static int cobalt_lcdfb_probe(struct platform_device *dev)
	info->screen_size = resource_size(res);
	info->screen_size = resource_size(res);
	info->screen_base = devm_ioremap(&dev->dev, res->start,
	info->screen_base = devm_ioremap(&dev->dev, res->start,
					 info->screen_size);
					 info->screen_size);
	if (!info->screen_base) {
		framebuffer_release(info);
		return -ENOMEM;
	}

	info->fbops = &cobalt_lcd_fbops;
	info->fbops = &cobalt_lcd_fbops;
	info->fix = cobalt_lcdfb_fix;
	info->fix = cobalt_lcdfb_fix;
	info->fix.smem_start = res->start;
	info->fix.smem_start = res->start;