summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-06-16 22:42:43 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:12 -0400
commita3c1e5207938b8c1cc7595bb9600858aa33b3daa (patch)
tree2985af7f97dc0f058bda89db6a29d1a8314cdd45
parente4bd707bb887dba76adca7ae2280983c6de59619 (diff)
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>
-rw-r--r--amdgpu/amdgpu_bo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 770a72be..07df1c56 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -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;