From: Nicolas Boichat Date: Thu, 4 Aug 2016 02:07:53 +0000 (+0800) Subject: egl/drm: Set disp->DriverData to NULL on error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9e8fb73977beaa407b72c4843e75db3b186ea09;p=mesa.git egl/drm: Set disp->DriverData to NULL on error Avoid use-after-free on error. Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display) Cc: "12.0" Signed-off-by: Nicolas Boichat Tested-by: Martin Peres Reviewed-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 9373496cd0d..1ce282fcaa6 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -726,5 +726,6 @@ cleanup: close(fd); free(dri2_dpy); + disp->DriverData = NULL; return EGL_FALSE; }