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@intel.com>
Reviewed-by: He Junyan <junyan.he@inbox.com>
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);