]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr
authorChristian König <christian.koenig@amd.com>
Tue, 31 Mar 2015 15:36:57 +0000 (17:36 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 23 Apr 2015 18:58:21 +0000 (14:58 -0400)
[ Upstream commit 863653fed0f449fb738295255cc834b271cfa088 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/gpu/drm/radeon/radeon_ttm.c

index d2510cfd3fea5a8f1ac604dc855b3f03bfebdc73..9ab8e269460229ffd8b5e568629111cece52d0e2 100644 (file)
@@ -575,6 +575,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);