Skip to content

Commit 242ef5d

Browse files
author
Sinclair Yeh
committed
drm/vmwgfx: Fix depth input into drm_mode_legacy_fb_format
Currently the pitch is passed in as depth. This causes drm_mode_legacy_fb_format() to return the wrong pixel format. The wrong pixel format will be rejected by vmw_kms_new_framebuffer(), thus leaving par->set_fb to NULL. This eventually causes a crash in vmw_fb_setcolreg() when the code tries to dereference par->set_fb. Signed-off-by: Sinclair Yeh <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]>
1 parent 54a07c7 commit 242ef5d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info)
481481
mode_cmd.height = var->yres;
482482
mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width;
483483
mode_cmd.pixel_format =
484-
drm_mode_legacy_fb_format(var->bits_per_pixel,
485-
((var->bits_per_pixel + 7) / 8) * mode_cmd.width);
484+
drm_mode_legacy_fb_format(var->bits_per_pixel, depth);
486485

487486
cur_fb = par->set_fb;
488487
if (cur_fb && cur_fb->width == mode_cmd.width &&

0 commit comments

Comments
 (0)