[Beignet] [PATCH] cl_api; Check image origin and region for NULL

Yang, Rong R rong.r.yang at intel.com
Thu May 12 02:48:19 UTC 2016


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Jan Vesely
> Sent: Friday, April 29, 2016 10:43
> To: beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH] cl_api; Check image origin and region for NULL
> 
> Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
> ---
>  src/cl_utils.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/cl_utils.h b/src/cl_utils.h index 0934d5f..2926611 100644
> --- a/src/cl_utils.h
> +++ b/src/cl_utils.h
> @@ -169,6 +169,11 @@ IMAGE = cl_mem_image(MEM);                                  \
>  const size_t *REGION;                                       \
>  size_t REGION ##_REC[3];                                    \
>  do {                                                        \
> +  if (PREGION == NULL)                                      \
> +  {                                                         \
> +    err = CL_INVALID_VALUE;                                 \
> +    goto error;                                             \
> +  }                                                         \
>    if (IMAGE->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) {   \
>      REGION ##_REC[0] = PREGION[0];                          \
>      REGION ##_REC[1] = 1;                                   \
> @@ -188,6 +193,11 @@ do {                                                        \
>  const size_t *REGION;                                       \
>  size_t REGION ##_REC[3];                                    \
>  do {                                                        \
> +  if (PREGION == NULL)                                      \
> +  {                                                         \
> +    err = CL_INVALID_VALUE;                                 \
> +    goto error;                                             \
> +  }                                                         \
>    if (IMAGE->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) {   \
>      REGION ##_REC[0] = PREGION[0];                          \
>      REGION ##_REC[1] = 0;                                   \
> --
> 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