summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_wayland.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2016-08-04 10:07:51 +0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-08-15 19:00:30 +0100
commit48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0 (patch)
tree59e268bd36db4ff9ad41ba229d5480e217acab72 /src/egl/drivers/dri2/platform_wayland.c
parent769ac1ec78e5bc52191ef0393e4702945bbacaa9 (diff)
downloadexternal_mesa3d-48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0.zip
external_mesa3d-48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0.tar.gz
external_mesa3d-48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0.tar.bz2
egl/wayland: Set disp->DriverData to NULL on error
Avoid use-after-free, fix spec@egl_khr_fence_sync@conformance. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" <mesa-stable@lists.freedesktop.org> Reported-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_wayland.c')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index e714e44..cbdcd76 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1236,6 +1236,7 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp)
wl_event_queue_destroy(dri2_dpy->wl_queue);
cleanup_dpy:
free(dri2_dpy);
+ disp->DriverData = NULL;
return EGL_FALSE;
}
@@ -1881,6 +1882,7 @@ dri2_initialize_wayland_swrast(_EGLDriver *drv, _EGLDisplay *disp)
wl_event_queue_destroy(dri2_dpy->wl_queue);
cleanup_dpy:
free(dri2_dpy);
+ disp->DriverData = NULL;
return EGL_FALSE;
}