egl: drop another indentation level in _eglFindDisplay() by inverting an if
[mesa.git] / src / egl / main / egldisplay.c
index 3df75ccd46c493660cb1f93754e508b384e9b019..83a47c6b8775908ae01e98ba110f4a642839fa63 100644 (file)
@@ -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);