[Beignet] [PATCH] driver: fix a potential Null reference.

He Junyan junyan.he at inbox.com
Tue Jun 17 02:28:09 PDT 2014


Really has risk here.
Thanks for fixing it 


On Tue, 2014-06-17 at 11:18 +0800, Zhigang Gong wrote:
> cl_gpgpu_flush may be called when the batch buffer has been
> released. We need to check whether there is a valid buffer
> before we really take the following actions.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  src/intel/intel_gpgpu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c
> index 1da6400..6af6e40 100644
> --- a/src/intel/intel_gpgpu.c
> +++ b/src/intel/intel_gpgpu.c
> @@ -555,6 +555,8 @@ intel_gpgpu_check_binded_buf_address(intel_gpgpu_t *gpgpu)
>  static void
>  intel_gpgpu_flush(intel_gpgpu_t *gpgpu)
>  {
> +  if (!gpgpu->batch || !gpgpu->batch->buffer)
> +    return;
>    intel_batchbuffer_emit_mi_flush(gpgpu->batch);
>    intel_batchbuffer_flush(gpgpu->batch);
>    intel_gpgpu_check_binded_buf_address(gpgpu);





More information about the Beignet mailing list