mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 17:10:11 +00:00
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>
This commit is contained in:
parent
a2eb65fcad
commit
1e7a047304
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue