mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 17:26:40 +07:00
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>
This commit is contained in:
parent
d2edb07b10
commit
d919ad49ac
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user