mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 11:50:17 +01:00
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>
This commit is contained in:
parent
933091e1d6
commit
bef8b6097c
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue