[Beignet] [PATCH 1/2] we should check the 'err' parameter
Lu Guanqun
guanqun.lu at intel.com
Mon Sep 23 00:06:23 PDT 2013
Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
src/cl_mem_gl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/cl_mem_gl.c b/src/cl_mem_gl.c
index 2d26226..28d2ac6 100644
--- a/src/cl_mem_gl.c
+++ b/src/cl_mem_gl.c
@@ -63,11 +63,9 @@ cl_mem_new_gl_texture(cl_context ctx,
goto error;
}
- mem = cl_mem_allocate(CL_MEM_GL_IMAGE_TYPE, ctx, flags, 0, 0, errcode_ret);
- if (mem == NULL) {
- err = CL_OUT_OF_HOST_MEMORY;
+ mem = cl_mem_allocate(CL_MEM_GL_IMAGE_TYPE, ctx, flags, 0, 0, &err);
+ if (mem == NULL || err != CL_SUCCESS)
goto error;
- }
mem->bo = cl_buffer_alloc_from_texture(ctx, texture_target, miplevel,
texture, cl_mem_image(mem));
More information about the Beignet
mailing list