egl/dri2: bail out on NULL dpy in dri2_display_release()

Currently all callers are careful enough not to do that, yet that will
not be the case in the future.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
Emil Velikov 2016-08-18 16:43:36 +01:00 committed by Emil Velikov
parent 8fb9ea413d
commit d6dcf3b4ca
1 changed files with 6 additions and 1 deletions

View File

@ -851,9 +851,14 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
static void
dri2_display_release(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_display *dri2_dpy;
unsigned i;
if (!disp)
return;
dri2_dpy = dri2_egl_display(disp);
assert(dri2_dpy->ref_count > 0);
dri2_dpy->ref_count--;