From b7461566b9ee6c2ea48e54e0e85da053e138efc7 Mon Sep 17 00:00:00 2001 From: Yang Rong Date: Tue, 29 Oct 2013 13:39:35 +0800 Subject: [PATCH] Fix a event segment fault. If event type is CL_COMMAND_USER, event->queue is NULL, cause segment fault. Change the order to fix it. Signed-off-by: Yang Rong Reviewed-by: "Xing, Homer" --- src/cl_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cl_api.c b/src/cl_api.c index 173810b..70a8d09 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -1228,8 +1228,8 @@ clGetEventProfilingInfo(cl_event event, CHECK_EVENT(event); - if (!(event->queue->props & CL_QUEUE_PROFILING_ENABLE) || - event->type == CL_COMMAND_USER || + if (event->type == CL_COMMAND_USER || + !(event->queue->props & CL_QUEUE_PROFILING_ENABLE) || event->status != CL_COMPLETE) { err = CL_PROFILING_INFO_NOT_AVAILABLE; goto error; -- 2.7.4