mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 08:39:52 +00:00
drm/nouveau: use post-decrement in error handling
We need to use post-decrement to get the dma_map_page undone also for i==0, and to avoid some very unpleasant behaviour if dma_map_page failed already at i==0. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
5fff80bbdb
commit
4fbbed46dc
@ -1520,7 +1520,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
|
||||
DMA_BIDIRECTIONAL);
|
||||
|
||||
if (dma_mapping_error(pdev, addr)) {
|
||||
while (--i) {
|
||||
while (i--) {
|
||||
dma_unmap_page(pdev, ttm_dma->dma_address[i],
|
||||
PAGE_SIZE, DMA_BIDIRECTIONAL);
|
||||
ttm_dma->dma_address[i] = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user