summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2016-05-06 00:11:47 +0800
committerYang Rong <rong.r.yang@intel.com>2016-05-23 18:07:21 +0800
commit0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c (patch)
treef70ad6a3ad08f579dcb587188253e3452b40959f /benchmark
parentd30f395244949742f8a0aad83e8720d3c50f0fe1 (diff)
utest: error handling to avoid null pointer dereference.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/benchmark_copy_buf.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/benchmark/benchmark_copy_buf.cpp b/benchmark/benchmark_copy_buf.cpp
index 92abf547..a85af8c9 100644
--- a/benchmark/benchmark_copy_buf.cpp
+++ b/benchmark/benchmark_copy_buf.cpp
@@ -16,6 +16,8 @@ double benchmark_copy_buf(void)
buf0 = (cl_char *)clEnqueueMapBuffer(queue, buf[0], CL_TRUE, CL_MAP_WRITE, 0, sizeof(char), 0, NULL, NULL, NULL);
+ OCL_ASSERT(buf0 != NULL);
+
for (i=0; i < sz; i++) {
buf0[i]=(rand() & 0xFF);
}