aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_gart.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-11-13 15:25:35 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-11-15 15:56:22 -0500
commit4cc948b94a222c310ae089c36718aac7a03aec90 (patch)
tree92c9765b93ee4e93b50eb4c4bd1b9f2497737b69 /drivers/gpu/drm/radeon/radeon_gart.c
parent99b4f25122f43210278cde17a9d100906235a074 (diff)
drm/radeon/vm: don't attempt to update ptes if ib allocation fails
If we fail to allocate an indirect buffer (ib) when updating the ptes, return an error instead of trying to use the ib. Avoids a null pointer dereference. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=58621 Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gart.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index cd7489b4d709..3044e504f4ec 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -1209,6 +1209,8 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
1209 return -ENOMEM; 1209 return -ENOMEM;
1210 1210
1211 r = radeon_ib_get(rdev, R600_RING_TYPE_DMA_INDEX, &ib, NULL, ndw * 4); 1211 r = radeon_ib_get(rdev, R600_RING_TYPE_DMA_INDEX, &ib, NULL, ndw * 4);
1212 if (r)
1213 return r;
1212 ib.length_dw = 0; 1214 ib.length_dw = 0;
1213 1215
1214 r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset); 1216 r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset);