[Mesa-dev] [PATCH 1/7] egl/dri2: Check return value of __DRI2fence::create_fence()
Kenneth Graunke
kenneth at whitecape.org
Wed May 6 16:07:52 PDT 2015
On Friday, May 01, 2015 01:01:56 PM Chad Versace wrote:
> From: Chad Versace <chad at kiwitree.net>
>
> If it returns NULL, then return early with an error.
>
> Cc: Marek Olšák <marek.olsak at amd.com>
> ---
> src/egl/drivers/dri2/egl_dri2.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 34d6bfe..c2a856f 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -2232,6 +2232,13 @@ dri2_create_sync(_EGLDriver *drv, _EGLDisplay *dpy,
> switch (type) {
> case EGL_SYNC_FENCE_KHR:
> dri2_sync->fence = dri2_dpy->fence->create_fence(dri2_ctx->dri_context);
> + if (!dri2_sync->fence) {
> + /* Why did it fail? DRI doesn't return an error code, so we emit
> + * a generic EGL error that doesn't communicate user error. */
> + _eglError(EGL_BAD_ALLOC, "eglCreateSyncKHR");
*/ goes on its own line in Mesa.
> + free(dri2_sync);
> + return NULL;
> + }
> break;
>
> case EGL_SYNC_CL_EVENT_KHR:
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150506/a964086b/attachment-0001.sig>
More information about the mesa-dev
mailing list