diff options
author | Christian König <christian.koenig@amd.com> | 2015-05-11 12:32:17 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-04 01:03:33 (GMT) |
commit | d919ad49ac04e1e417ea511d61455786a0f0fdb7 (patch) | |
tree | 89f8b02596095c3414c6d905f25848af0553a843 /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |
parent | d2edb07b10fce5127a60671b55ca53921c212bc3 (diff) | |
download | linux-d919ad49ac04e1e417ea511d61455786a0f0fdb7.tar.xz |
drm/amdgpu: fix dereference before check
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 66c66f8..74ed94e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -138,9 +138,9 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib) int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, struct amdgpu_ib *ibs, void *owner) { - struct amdgpu_ring *ring; - struct amdgpu_vm *vm = ibs->vm; struct amdgpu_ib *ib = &ibs[0]; + struct amdgpu_ring *ring; + struct amdgpu_vm *vm; unsigned i; int r = 0; @@ -148,6 +148,8 @@ int amdgpu_ib_schedule(struct amdgpu_device *adev, unsigned num_ibs, return -EINVAL; ring = ibs->ring; + vm = ibs->vm; + if (!ring->ready) { dev_err(adev->dev, "couldn't schedule ib\n"); return -EINVAL; |