summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonk.liu <monk.liu@amd.com>2015-05-05 15:15:15 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:09 -0400
commit3affecadd0d55ce43915a7da2444a4ee9c63495c (patch)
treeb3fd2d8ad7f5fb17aab737d9ecbff8223aea55a0
parentfe655b36d04a88dba4c480d5c28f054c7d3d6ba7 (diff)
amdgpu: fix segfault when resources are NULL
Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
-rw-r--r--amdgpu/amdgpu_cs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 8a473a1d..b3defb84 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -659,7 +659,8 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
memset(&cs, 0, sizeof(cs));
cs.in.chunks = (uint64_t)(uintptr_t)chunk_array;
cs.in.ctx_id = context->id;
- cs.in.bo_list_handle = ibs_request->resources->handle;
+ if (ibs_request->resources)
+ cs.in.bo_list_handle = ibs_request->resources->handle;
cs.in.num_chunks = ibs_request->number_of_ibs;
/* IB chunks */
for (i = 0; i < ibs_request->number_of_ibs; i++) {