Skip to content

Commit 40510a9

Browse files
author
Thomas Hellström
committed
drm/ttm: Fix an invalid freeing on already freed page in error path
If caching mode change fails due to, for example, OOM we free the allocated pages in a two-step process. First the pages for which the caching change has already succeeded. Secondly the pages for which a caching change did not succeed. However the second step was incorrectly freeing the pages already freed in the first step. Fix. Signed-off-by: Thomas Hellström <[email protected]> Fixes: 379989e ("drm/ttm/pool: Fix ttm_pool_alloc error path") Cc: Christian König <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Christian Koenig <[email protected]> Cc: Huang Rui <[email protected]> Cc: [email protected] Cc: <[email protected]> # v6.4+ Reviewed-by: Matthew Auld <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ed683b9 commit 40510a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/ttm/ttm_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static void ttm_pool_free_range(struct ttm_pool *pool, struct ttm_tt *tt,
387387
enum ttm_caching caching,
388388
pgoff_t start_page, pgoff_t end_page)
389389
{
390-
struct page **pages = tt->pages;
390+
struct page **pages = &tt->pages[start_page];
391391
unsigned int order;
392392
pgoff_t i, nr;
393393

0 commit comments

Comments
 (0)