diff mbox

[1/1] drm/ttm: Fix accounting error when fail to get pages for pool

Message ID BLUPR12MB044923B80FB13FACC4DA726E84820@BLUPR12MB0449.namprd12.prod.outlook.com (mailing list archive)
State New, archived
Headers show

Commit Message

Liu, Monk Aug. 16, 2017, 7:25 a.m. UTC
Reviewed-by: Monk Liu <monk.liu@amd.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index eeddc1e..8715998 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -615,7 +615,7 @@  static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the pool. */
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);