Just two small fixes in the ttm_tt_populate error handling; one for radeon, one for amdgpu. * 'drm-fixes-4.5' of git://people.freedesktop.org/~agd5f/linux: drm/radeon: use post-decrement in error handling drm/amdgpu: use post-decrement in error handling
Unified · Split
| @@ -712,7 +712,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm) · 711 unmodified lines | ||
| 712 | 712 | 0, PAGE_SIZE, |
| 713 | 713 | PCI_DMA_BIDIRECTIONAL); |
| 714 | 714 | if (pci_dma_mapping_error(adev->pdev, gtt->ttm.dma_address[i])) { |
| 715 | − while (--i) { | |
| 715 | + while (i--) { | |
| 716 | 716 | pci_unmap_page(adev->pdev, gtt->ttm.dma_address[i], |
| 717 | 717 | PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); |
| 718 | 718 | gtt->ttm.dma_address[i] = 0; |
| @@ -758,7 +758,7 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm) · 757 unmodified lines | ||
| 758 | 758 | 0, PAGE_SIZE, |
| 759 | 759 | PCI_DMA_BIDIRECTIONAL); |
| 760 | 760 | if (pci_dma_mapping_error(rdev->pdev, gtt->ttm.dma_address[i])) { |
| 761 | − while (--i) { | |
| 761 | + while (i--) { | |
| 762 | 762 | pci_unmap_page(rdev->pdev, gtt->ttm.dma_address[i], |
| 763 | 763 | PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); |
| 764 | 764 | gtt->ttm.dma_address[i] = 0; |