drm/radeon/vm: don't attempt to update ptes if ib allocation fails

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:10 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4cc948b94a222c310ae089c36718aac7a03aec90
Commit:     4cc948b94a222c310ae089c36718aac7a03aec90
Parent:     99b4f25122f43210278cde17a9d100906235a074
Author:     Alex Deucher <alexander.deucher at amd.com>
AuthorDate: Wed Nov 13 15:25:35 2013 -0500
Committer:  Alex Deucher <alexander.deucher at amd.com>
CommitDate: Fri Nov 15 15:56:22 2013 -0500

    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 at amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
    Cc: stable at vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_gart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index cd7489b..3044e50 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,
 		return -ENOMEM;
 
 	r = radeon_ib_get(rdev, R600_RING_TYPE_DMA_INDEX, &ib, NULL, ndw * 4);
+	if (r)
+		return r;
 	ib.length_dw = 0;
 
 	r = radeon_vm_update_pdes(rdev, vm, &ib, bo_va->soffset, bo_va->eoffset);



More information about the linux-mtd-cvs mailing list