summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-06-16 22:42:43 +0800
committerJammy Zhou <Jammy.Zhou@amd.com>2015-06-17 09:50:03 +0800
commitf768dd1aaa6d023acfbde5f3ba64acff099bcfdb (patch)
tree8c5f6d8870a7ec09de6f0a16a25b2cd268db825f
parent90efaf1ce0d362262544dc5649e93c061d036147 (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 4ffb5ebd..fae1003b 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;