Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: Initialize drm_mode_fb_cmd2

Transition to drm_mode_fb_cmd2 from drm_mode_fb_cmd left the structure
unitialized. drm_mode_fb_cmd2 adds a few additional members, e.g. flags
and modifiers which were never initialized. Garbage in those members
can cause random failures during the bringup of the fbcon.

Initializing the structure fixes random blank screens after bootup due
to flags/modifiers mismatches during the fbcon bring up.

Fixes: dabdcdc9822a ("drm/vmwgfx: Switch to mode_cmd2")
Signed-off-by: Zack Rusin <zackr@vmware.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: <stable@vger.kernel.org> # v4.10+
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-7-zack@kde.org

+1 -1
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 483 483 484 484 static int vmw_fb_kms_framebuffer(struct fb_info *info) 485 485 { 486 - struct drm_mode_fb_cmd2 mode_cmd; 486 + struct drm_mode_fb_cmd2 mode_cmd = {0}; 487 487 struct vmw_fb_par *par = info->par; 488 488 struct fb_var_screeninfo *var = &info->var; 489 489 struct drm_framebuffer *cur_fb;