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

Yang, Rong R rong.r.yang at intel.com
Fri Sep 2 08:08:27 UTC 2016


LGTM, pushed, thanks for your contribution.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Jan Vesely
> Sent: Friday, September 2, 2016 13:34
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] api: check kernel parameter before accessing it
> 
> 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
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list