From 0dc0a79a581b91aec301991706242f11aeb1473b Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Tue, 18 Aug 2020 11:48:54 +0200 Subject: [PATCH] egl: drop another indentation level in _eglFindDisplay() by inverting an if Signed-off-by: Eric Engestrom Reviewed-by: Alyssa Rosenzweig Part-of: --- src/egl/main/egldisplay.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 3df75ccd46c..83a47c6b877 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -261,26 +261,28 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy, /* create a new display */ assert(!disp); disp = calloc(1, sizeof(_EGLDisplay)); - if (disp) { - mtx_init(&disp->Mutex, mtx_plain); - disp->Platform = plat; - disp->PlatformDisplay = plat_dpy; - num_attribs = _eglNumAttribs(attrib_list); - if (num_attribs) { - disp->Options.Attribs = calloc(num_attribs, sizeof(EGLAttrib)); - if (!disp->Options.Attribs) { - free(disp); - disp = NULL; - goto out; - } - memcpy(disp->Options.Attribs, attrib_list, - num_attribs * sizeof(EGLAttrib)); + if (!disp) + goto out; + + mtx_init(&disp->Mutex, mtx_plain); + disp->Platform = plat; + disp->PlatformDisplay = plat_dpy; + num_attribs = _eglNumAttribs(attrib_list); + if (num_attribs) { + disp->Options.Attribs = calloc(num_attribs, sizeof(EGLAttrib)); + if (!disp->Options.Attribs) { + free(disp); + disp = NULL; + goto out; } - /* add to the display list */ - disp->Next = _eglGlobal.DisplayList; - _eglGlobal.DisplayList = disp; + memcpy(disp->Options.Attribs, attrib_list, + num_attribs * sizeof(EGLAttrib)); } + /* add to the display list */ + disp->Next = _eglGlobal.DisplayList; + _eglGlobal.DisplayList = disp; + out: mtx_unlock(_eglGlobal.Mutex); -- 2.30.2