if (name && !dri2_dpy->image->queryImage(dri2_img->dri_image,
__DRI_IMAGE_ATTRIB_NAME, name))
- return _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa");
+ return dri2_egl_error_unlock(dri2_dpy, EGL_BAD_ALLOC,
+ "dri2_export_drm_image_mesa");
if (handle)
dri2_dpy->image->queryImage(dri2_img->dri_image,
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
EGLint nplanes;
- if (!dri2_can_export_dma_buf_image(disp, img))
+ if (!dri2_can_export_dma_buf_image(disp, img)) {
+ mtx_unlock(&dri2_dpy->lock);
return EGL_FALSE;
+ }
/* EGL_MESA_image_dma_buf_export spec says:
* "If the number of fds is less than the number of planes, then