From: Eric Engestrom Date: Mon, 26 Aug 2019 14:29:49 +0000 (+0100) Subject: egl: fix deadlock in malloc error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43d470404c47d86d1fab93d1345e09375bcf4fb6;p=mesa.git egl: fix deadlock in malloc error path Fixes: cb0980e69aa921af7086 ("egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}") Signed-off-by: Eric Engestrom Reviewed-by: Tapani Pälli --- 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); }