[Beignet] [PATCH] Fix a event segment fault.

Yang Rong rong.r.yang at intel.com
Tue Oct 29 06:39:35 CET 2013


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 at intel.com>
---
 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 f668ec6..2aca3f8 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;
-- 
1.8.1.2



More information about the Beignet mailing list