summaryrefslogtreecommitdiff
path: root/src/performance.c
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2016-05-06 00:11:46 +0800
committerYang Rong <rong.r.yang@intel.com>2016-05-23 18:07:19 +0800
commitd30f395244949742f8a0aad83e8720d3c50f0fe1 (patch)
tree6bf2261a97f0d1feb08216dcfed495fdd8b805b2 /src/performance.c
parent631c31d611d154a42f4255264211fe321b861038 (diff)
runtime: 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 'src/performance.c')
-rw-r--r--src/performance.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/performance.c b/src/performance.c
index 85cd481d..28bd6c62 100644
--- a/src/performance.c
+++ b/src/performance.c
@@ -280,6 +280,9 @@ static void insert(cl_context context, const char *kernel_name, const char *buil
}
context_storage_node *p_context = find_context(context);
kernel_storage_node *p_kernel = find_kernel(p_context, kernel_name, build_opt);
+ if(!p_kernel)
+ return;
+
prev_context_pointer = p_context;
prev_kernel_pointer = p_kernel;
p_kernel->kernel_times[p_kernel->current_count++] = time;