Skip to content

Commit 02f76a9

Browse files
arunpravin24ChristianKoenigAMD
authored andcommitted
drm/buddy: Modify duplicate list_splice_tail call
Remove the duplicate list_splice_tail call when the total_allocated < size condition is true. Cc: <[email protected]> # 6.7+ Fixes: 8746c6c ("drm/buddy: Fix alloc_range() error handling code") Reported-by: Bert Karwatzki <[email protected]> Signed-off-by: Arunpravin Paneer Selvam <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
1 parent a64056b commit 02f76a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/drm_buddy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
538538
list_add(&block->left->tmp_link, dfs);
539539
} while (1);
540540

541-
list_splice_tail(&allocated, blocks);
542-
543541
if (total_allocated < size) {
544542
err = -ENOSPC;
545543
goto err_free;
546544
}
547545

546+
list_splice_tail(&allocated, blocks);
547+
548548
return 0;
549549

550550
err_undo:

0 commit comments

Comments
 (0)