浏览代码

drm/ttm: Initialize local lists in ttm_bo_bulk_move_helper

The first parameter of list_cut_position() must point to an initialized
list.

Noticed thanks to KASAN pointing out something's fishy here.

Fixes: "drm/ttm: add bulk move function on LRU"
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Michel Dänzer 7 年之前
父节点
当前提交
25eef4214a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpu/drm/ttm/ttm_bo.c

+ 2 - 1
drivers/gpu/drm/ttm/ttm_bo.c

@@ -250,7 +250,8 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail);
 static void ttm_bo_bulk_move_helper(struct ttm_lru_bulk_move_pos *pos,
 static void ttm_bo_bulk_move_helper(struct ttm_lru_bulk_move_pos *pos,
 				    struct list_head *lru, bool is_swap)
 				    struct list_head *lru, bool is_swap)
 {
 {
-	struct list_head entries, before;
+	LIST_HEAD(entries);
+	LIST_HEAD(before);
 	struct list_head *list1, *list2;
 	struct list_head *list1, *list2;
 
 
 	list1 = is_swap ? &pos->last->swap : &pos->last->lru;
 	list1 = is_swap ? &pos->last->swap : &pos->last->lru;