From a0912ef5b73c74f3277951ef91549d287ab45fe8 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 2 Jun 2015 14:42:33 +0900 Subject: ecore-buffer: fix wrong check for failure case Change-Id: I3e59d41166b4c8180f643c7b825836186ed469a6 --- src/lib/ecore_buffer/ecore_buffer.c | 5 ++--- src/modules/ecore_buffer/x11_dri2/ecore_buffer_x11_dri2.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_buffer/ecore_buffer.c b/src/lib/ecore_buffer/ecore_buffer.c index 818dfa2d6f..84564017c7 100644 --- a/src/lib/ecore_buffer/ecore_buffer.c +++ b/src/lib/ecore_buffer/ecore_buffer.c @@ -86,11 +86,10 @@ _ecore_buffer_get_backend(const char *name) else bm = eina_hash_find(_backends, backend_name); - if ((!bm) || (!bm->be)) + if ((!bm) || (!bm->be) || (!bm->be->init)) return NULL; - if ((!bm->data) && (bm->be->init)) - bm->data = bm->be->init(NULL, NULL); + bm->data = bm->be->init(NULL, NULL); return bm; } diff --git a/src/modules/ecore_buffer/x11_dri2/ecore_buffer_x11_dri2.c b/src/modules/ecore_buffer/x11_dri2/ecore_buffer_x11_dri2.c index 5ce3c4918a..e51d9edddb 100644 --- a/src/modules/ecore_buffer/x11_dri2/ecore_buffer_x11_dri2.c +++ b/src/modules/ecore_buffer/x11_dri2/ecore_buffer_x11_dri2.c @@ -253,7 +253,7 @@ _ecore_buffer_x11_dri2_init(const char *context EINA_UNUSED, const char *options if (fd < 0) goto on_error; - if (!(drmGetMagic(fd, &magic))) + if (drmGetMagic(fd, &magic) < 0) goto on_error; if (!(DRI2Authenticate(xdpy, root, magic))) -- cgit v1.2.1