[PATCH] drm/ttm: Fix hardcoded LRU index in ttm_device_fini()
From: Hongfu Li
Date: Wed Jul 15 2026 - 05:07:09 EST
From: Hongfu Li <lihongfu@xxxxxxxxxx>
ttm_device_fini() iterates over all TTM_MAX_BO_PRIORITY LRU lists
using loop variable i, but list_empty() always checks man->lru[0]
instead of man->lru[i]. This means the debug message only checks
priority 0 and prints the same result four times.
Fixes: 8af8a109b34f ("drm/ttm: device naming cleanup")
Signed-off-by: Hongfu Li <lihongfu@xxxxxxxxxx>
---
drivers/gpu/drm/ttm/ttm_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
index d3bfb9a696a7..e22c77f4228e 100644
--- a/drivers/gpu/drm/ttm/ttm_device.c
+++ b/drivers/gpu/drm/ttm/ttm_device.c
@@ -266,7 +266,7 @@ void ttm_device_fini(struct ttm_device *bdev)
spin_lock(&bdev->lru_lock);
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i)
- if (list_empty(&man->lru[0]))
+ if (list_empty(&man->lru[i]))
pr_debug("Swap list %d was clean\n", i);
spin_unlock(&bdev->lru_lock);
--
2.54.0