summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@intel.com>2013-09-23 15:06:23 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-09-26 10:13:54 +0800
commit33545728053dc5209e36fcd9b8953935952ca33c (patch)
tree293096e5ba503307689ec3c178253d297531ed05
parent81a7569b8258771abf553378ee5768caaeb9d3f6 (diff)
we should check the 'err' parameter
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/cl_mem_gl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cl_mem_gl.c b/src/cl_mem_gl.c
index 2d262264..28d2ac65 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));