summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-03-31 17:36:57 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-04-02 10:03:29 -0400
commit863653fed0f449fb738295255cc834b271cfa088 (patch)
tree655d4ce062c70dcc6dee18bd2d0fe3b99b24433a
parent91fd89660ba2e8ee59a587294fa9b17761691b05 (diff)
downloadop-kernel-dev-863653fed0f449fb738295255cc834b271cfa088.zip
op-kernel-dev-863653fed0f449fb738295255cc834b271cfa088.tar.gz
drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr
We somehow try to free the SG table twice. Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=89734 Signed-off-by: Christian König <christian.koenig@amd.com> Cc: <stable@vger.kernel.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index d02aa1d..b292aca 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -598,6 +598,10 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
enum dma_data_direction direction = write ?
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
+ /* double check that we don't free the table twice */
+ if (!ttm->sg->sgl)
+ return;
+
/* free the sg table and pages again */
dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
OpenPOWER on IntegriCloud