History

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.

Rasmus Villemoes committed 10 years ago

Commit 4fbbed41 parent 5fff80b1 file · +1 −1Browse files

Unified · Split

drivers/gpu/drm/nouveau/nouveau_bo.c+1−1
@@ -1520,7 +1520,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) · 1519 unmodified lines
15201520 DMA_BIDIRECTIONAL);
15211521
15221522 if (dma_mapping_error(pdev, addr)) {
1523− while (--i) {
1523+ while (i--) {
15241524 dma_unmap_page(pdev, ttm_dma->dma_address[i],
15251525 PAGE_SIZE, DMA_BIDIRECTIONAL);
15261526 ttm_dma->dma_address[i] = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t