Skip to contentSkip to conversation

Patch "video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Aug 4, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

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

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
video-fbdev-cobalt_lcdfb-handle-return-null-error-from-devm_ioremap.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 4 15:30:20 PDT 2017

From: Arvind Yadav <[email protected]>
Date: Tue, 13 Dec 2016 13:50:52 +0530
Subject: video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap

From: Arvind Yadav <[email protected]>

[ 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.

---
 drivers/video/fbdev/cobalt_lcdfb.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/video/fbdev/cobalt_lcdfb.c +5 -0
@@ -350,6 +350,11 @@ static int cobalt_lcdfb_probe(struct pla
 	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;

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/vfio-pci-handle-error-from-pci_iomap.patch queue-4.4/video-fbdev-cobalt_lcdfb-handle-return-null-error-from-devm_ioremap.patch