Skip to content

Commit

Permalink
efifb: exit if framebuffer address is invalid
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Peter Jones <pjones@redhat.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthew Garrett authored and Linus Torvalds committed Apr 13, 2009
1 parent 0ca1071 commit 133bb07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/video/efifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 133bb07

Please sign in to comment.