Skip to contentSkip to conversation

efifb: Exit if framebuffer address is invalid

PATCH New Matthew Garrett 1 participant 1 message Apr 1, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efifb: Exit if framebuffer address is invalid

efifb will attempt to ioremap a framebuffer even if its starting address is 0, failing and causing an ugly backtrace in the process. Exit before probing if this is the case.

---
 drivers/video/efifb.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/video/efifb.c +5 -2
index 0c5b9a9..8dea2bc 100644
@@ -210,12 +210,15 @@ static int __init efifb_probe(struct platform_device *dev)
 	unsigned int size_total;
 	int request_succeeded = 0;
 
-	printk(KERN_INFO "efifb: probing for efifb\n");
-
 	if (!screen_info.lfb_depth)
 		screen_info.lfb_depth = 32;
 	if (!screen_info.pages)
 		screen_info.pages = 1;
+	if (!screen_info.lfb_base) {
+		printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
+		return -ENODEV;
+	}
+	printk(KERN_INFO "efifb: probing for efifb\n");
 
 	/* just assume they're all unset if any are */
 	if (!screen_info.blue_size) {
Signature · 1 line
Matthew Garrett | [email protected]