From 1a4e7d72930c081b760caa6918836e46fd791bad Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 26 Aug 2019 15:29:49 +0100 Subject: egl: fix deadlock in malloc error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: cb0980e69aa921af7086 ("egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}") Signed-off-by: Eric Engestrom Reviewed-by: Tapani Pälli (cherry picked from commit 43d470404c47d86d1fab93d1345e09375bcf4fb6) --- src/egl/main/egldriver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/egl') diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index e719b19a63f..0d8919aa0e1 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -56,8 +56,10 @@ _eglGetDriver(void) if (!_eglDriver) { _eglDriver = calloc(1, sizeof(*_eglDriver)); - if (!_eglDriver) + if (!_eglDriver) { + mtx_unlock(&_eglModuleMutex); return NULL; + } _eglInitDriver(_eglDriver); } -- cgit v1.2.3