From: Thomas Hellstrom Date: Wed, 15 Jan 2014 07:51:36 +0000 (+0100) Subject: drm/vmwgfx: Fix surface framebuffer check for guest-backed surfaces X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b360a3cecd3a2e14e56798b570007d4763f21b74;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/vmwgfx: Fix surface framebuffer check for guest-backed surfaces With guest-backed surfaces, surface->sizes == NULL, causing a kernel oops. Use the base_size member instead. Signed-off-by: Thomas Hellstrom Reviewed-by: Jakob Bornecrantz Reviewed-by: Brian Paul --- diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index c597d8936290..8a650413dea5 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -672,9 +672,9 @@ static int vmw_kms_new_framebuffer_surface(struct vmw_private *dev_priv, if (unlikely(surface->mip_levels[0] != 1 || surface->num_sizes != 1 || - surface->sizes[0].width < mode_cmd->width || - surface->sizes[0].height < mode_cmd->height || - surface->sizes[0].depth != 1)) { + surface->base_size.width < mode_cmd->width || + surface->base_size.height < mode_cmd->height || + surface->base_size.depth != 1)) { DRM_ERROR("Incompatible surface dimensions " "for requested mode.\n"); return -EINVAL;