[Beignet] [PATCH] api: check kernel parameter before accessing it

Jan Vesely jano.vesely at gmail.com
Fri Sep 2 05:33:36 UTC 2016


Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
---
 src/cl_device_id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index 08cc0c0..3913223 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -1157,12 +1157,12 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,
 {
   int err = CL_SUCCESS;
   int dimension = 0;
+  CHECK_KERNEL(kernel);
   if (device == NULL)
     device = kernel->program->ctx->device;
   if (UNLIKELY(is_gen_device(device) == CL_FALSE))
     return CL_INVALID_DEVICE;
 
-  CHECK_KERNEL(kernel);
   switch (param_name) {
     case CL_KERNEL_WORK_GROUP_SIZE:
     {
-- 
2.7.4



More information about the Beignet mailing list