]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Sanity test on vesa parameters before setting up kernel screen_info
authorBin Meng <bmeng.cn@gmail.com>
Thu, 30 Jul 2015 10:49:13 +0000 (03:49 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:00:49 +0000 (08:00 +0200)
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>
drivers/pci/pci_rom.c

index a33efae2636a4593fdb366bd5c62a91e58cb506b..26db3ca0a1344c7b928168ff301be507cfff695b 100644 (file)
@@ -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;