Waffle aims to keep the main code path in it's core, with the
error path diverging via goto labels and alike.

Follow the approach and update the gbm code.

Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com>
---
 src/waffle/gbm/wgbm_platform.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/waffle/gbm/wgbm_platform.c b/src/waffle/gbm/wgbm_platform.c
index 0fc0352..9ba1340 100644
--- a/src/waffle/gbm/wgbm_platform.c
+++ b/src/waffle/gbm/wgbm_platform.c
@@ -137,11 +137,11 @@ wgbm_platform_create(void)
     if (self == NULL)
         return NULL;
 
-    if (wgbm_platform_init(self))
-        return &self->wegl.wcore;
-
-    wgbm_platform_destroy(&self->wegl.wcore);
-    return NULL;
+    if (!wgbm_platform_init(self)) {
+        wgbm_platform_destroy(&self->wegl.wcore);
+        return NULL;
+    }
+    return &self->wegl.wcore;
 }
 
 bool
-- 
2.9.0

_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to