summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2014-07-02 14:21:45 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2014-07-03 03:46:13 -0700
commit0a596fd0c92fdcf73071869a59029263a2596018 (patch)
tree02df98e9839d40e2c49072b570cf94fa0590153b
parent4e378a730d2d2deffc915af2a3d013d2a994a1b0 (diff)
vmware/vmwgfx: Fix an error path segfault
Part of freedesktop.org bugzilla bug #80645 If taking a scanout reference on a pixmap fails, the struct vmwgfx_screen_entry::pixmap pointer must be set to NULL, otherwise the driver will incorrectly attempt to remove the scanout reference in the error path, causing a segfault. This problem is seen in the above-mentioned bug, but it is not the root cause of the problem. With this patch applied, the server will terminate cleanly instead of segfaulting. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--vmwgfx/vmwgfx_crtc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c
index 5fce5f7..4f9cdda 100644
--- a/vmwgfx/vmwgfx_crtc.c
+++ b/vmwgfx/vmwgfx_crtc.c
@@ -193,6 +193,7 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtcp->entry.pixmap = pixmap;
crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry);
if (crtcp->scanout_id == -1) {
+ crtcp->entry.pixmap = NULL;
LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n");
return FALSE;
}