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 <rong.r.yang@intel.com>
Reviewed-by: "Xing, Homer" <homer.xing@intel.com>
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;