Skip to content

Commit 1d2c0c5

Browse files
Dan CarpenterRoland Scheidegger
authored andcommitted
drm/vmwgfx: Use correct vmw_legacy_display_unit pointer
The "entry" pointer is an offset from the list head and it doesn't point to a valid vmw_legacy_display_unit struct. Presumably the intent was to point to the last entry. Also the "i++" wasn't used so I have removed that as well. Fixes: d7e1958 ("drm/vmwgfx: Support older hardware.") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Roland Scheidegger <[email protected]>
1 parent 4f88b4c commit 1d2c0c5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
8181
struct vmw_legacy_display_unit *entry;
8282
struct drm_framebuffer *fb = NULL;
8383
struct drm_crtc *crtc = NULL;
84-
int i = 0;
84+
int i;
8585

8686
/* If there is no display topology the host just assumes
8787
* that the guest will set the same layout as the host.
@@ -92,12 +92,11 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
9292
crtc = &entry->base.crtc;
9393
w = max(w, crtc->x + crtc->mode.hdisplay);
9494
h = max(h, crtc->y + crtc->mode.vdisplay);
95-
i++;
9695
}
9796

9897
if (crtc == NULL)
9998
return 0;
100-
fb = entry->base.crtc.primary->state->fb;
99+
fb = crtc->primary->state->fb;
101100

102101
return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
103102
fb->format->cpp[0] * 8,

0 commit comments

Comments
 (0)