diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-07-30 03:49:13 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-05 08:42:38 -0600 |
commit | 1e7a04730426a96110989ed9c2bafb0d66ec2428 (patch) | |
tree | bb24547509ecf520ef441542132656ed3e3ddb90 | |
parent | a2eb65fcad4c66ee6992e18d8bea15fd0b07886e (diff) | |
download | u-boot-imx-1e7a04730426a96110989ed9c2bafb0d66ec2428.zip u-boot-imx-1e7a04730426a96110989ed9c2bafb0d66ec2428.tar.gz u-boot-imx-1e7a04730426a96110989ed9c2bafb0d66ec2428.tar.bz2 |
x86: Sanity test on vesa parameters before setting up kernel screen_info
We should not set up kernel screen_info when the vesa parameters are
insane, otherwise kernel will panic.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | drivers/pci/pci_rom.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index a33efae..26db3ca 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -235,6 +235,10 @@ void setup_video(struct screen_info *screen_info) #ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE struct vesa_mode_info *vesa = &mode_info.vesa; + /* Sanity test on VESA parameters */ + if (!vesa->x_resolution || !vesa->y_resolution) + return; + screen_info->orig_video_isVGA = VIDEO_TYPE_VLFB; screen_info->lfb_width = vesa->x_resolution; |