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>
main
monk.liu 2015-05-05 15:15:15 +08:00 committed by Alex Deucher
parent c68d58aa14
commit 3b50db9d9f
1 changed files with 2 additions and 1 deletions

View File

@ -659,7 +659,8 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
memset(&cs, 0, sizeof(cs)); memset(&cs, 0, sizeof(cs));
cs.in.chunks = (uint64_t)(uintptr_t)chunk_array; cs.in.chunks = (uint64_t)(uintptr_t)chunk_array;
cs.in.ctx_id = context->id; 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; cs.in.num_chunks = ibs_request->number_of_ibs;
/* IB chunks */ /* IB chunks */
for (i = 0; i < ibs_request->number_of_ibs; i++) { for (i = 0; i < ibs_request->number_of_ibs; i++) {