Skip to content

Commit

Permalink
drm/buddy: Modify duplicate list_splice_tail call
Browse files Browse the repository at this point in the history
Remove the duplicate list_splice_tail call when the
total_allocated < size condition is true.

Cc: <stable@vger.kernel.org> # 6.7+
Fixes: 8746c6c ("drm/buddy: Fix alloc_range() error handling code")
Reported-by: Bert Karwatzki <spasswolf@web.de>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240216100048.4101-1-Arunpravin.PaneerSelvam@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Arunpravin Paneer Selvam authored and Christian König committed Feb 16, 2024
1 parent a64056b commit 02f76a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_buddy.c
Original file line number Diff line number Diff line change
@@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
list_add(&block->left->tmp_link, dfs);
} while (1);

list_splice_tail(&allocated, blocks);

if (total_allocated < size) {
err = -ENOSPC;
goto err_free;
}

list_splice_tail(&allocated, blocks);

return 0;

err_undo:

0 comments on commit 02f76a9

Please sign in to comment.