amdgpu: do NULL check for bo handle in amdgpu_bo_query_info
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>main
parent
933091e1d6
commit
bef8b6097c
|
@ -225,6 +225,10 @@ int amdgpu_bo_query_info(amdgpu_bo_handle bo,
|
|||
struct drm_amdgpu_gem_op gem_op = {};
|
||||
int r;
|
||||
|
||||
/* Validate the BO passed in */
|
||||
if (!bo->handle)
|
||||
return -EINVAL;
|
||||
|
||||
/* Query metadata. */
|
||||
metadata.handle = bo->handle;
|
||||
metadata.op = AMDGPU_GEM_METADATA_OP_GET_METADATA;
|
||||
|
|
Loading…
Reference in New Issue