diff options
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_ttm.c | 4 |
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 d02aa1d0f588..b292aca0f342 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) | |||
| 598 | enum dma_data_direction direction = write ? | 598 | enum dma_data_direction direction = write ? |
| 599 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; | 599 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; |
| 600 | 600 | ||
| 601 | /* double check that we don't free the table twice */ | ||
| 602 | if (!ttm->sg->sgl) | ||
| 603 | return; | ||
| 604 | |||
| 601 | /* free the sg table and pages again */ | 605 | /* free the sg table and pages again */ |
| 602 | dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction); | 606 | dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction); |
| 603 | 607 | ||
