diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2016-05-06 00:11:46 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-05-23 18:07:19 +0800 |
commit | d30f395244949742f8a0aad83e8720d3c50f0fe1 (patch) | |
tree | 6bf2261a97f0d1feb08216dcfed495fdd8b805b2 /src/intel | |
parent | 631c31d611d154a42f4255264211fe321b861038 (diff) |
runtime: error handling to avoid null pointer dereference.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/intel_gpgpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c index f9ff4a06..39b7e4db 100644 --- a/src/intel/intel_gpgpu.c +++ b/src/intel/intel_gpgpu.c @@ -180,6 +180,9 @@ void intel_gpgpu_delete_all(intel_driver_t *drv) static void intel_gpgpu_delete(intel_gpgpu_t *gpgpu) { + if (gpgpu == NULL) + return; + intel_driver_t *drv = gpgpu->drv; struct intel_gpgpu_node *p, *node; @@ -205,7 +208,6 @@ intel_gpgpu_delete(intel_gpgpu_t *gpgpu) drv->gpgpu_list = drv->gpgpu_list->next; intel_gpgpu_delete_finished(node->gpgpu); cl_free(node); - node = p->next; } } if (gpgpu == NULL) |