Mesa (master): egl/wayland: Set disp->DriverData to NULL on error

Emil Velikov evelikov at kemper.freedesktop.org
Mon Aug 15 18:04:29 UTC 2016


Module: Mesa
Branch: master
Commit: 48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=48fd952f28a5fcd71eed5a60c8e3a10231c7a5b0

Author: Nicolas Boichat <drinkcat at chromium.org>
Date:   Thu Aug  4 10:07:51 2016 +0800

egl/wayland: Set disp->DriverData to NULL on error

Avoid use-after-free, fix spec at egl_khr_fence_sync@conformance.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable at lists.freedesktop.org>
Reported-by: Michel Dänzer <michel at daenzer.net>
Signed-off-by: Nicolas Boichat <drinkcat at chromium.org>
Tested-by: Martin Peres <martin.peres at linux.intel.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

---

 src/egl/drivers/dri2/platform_wayland.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 }




More information about the mesa-commit mailing list