Skip to contentSkip to conversation

drm/ttm: Initialize local lists in ttm_bo_bulk_move_helper

PATCH In review Michel Dänzer 2 participants 2 messages Aug 28, 2018 – Aug 29, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Initialize local lists in ttm_bo_bulk_move_helper

From: Michel Dänzer <[email protected]>

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"
---
 drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index 39d9d559b279..35d53d81f486 100644
@@ -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,
 				    struct list_head *lru, bool is_swap)
 {
-	struct list_head entries, before;
+	LIST_HEAD(entries);
+	LIST_HEAD(before);
 	struct list_head *list1, *list2;
 
 	list1 = is_swap ? &pos->last->swap : &pos->last->lru;
Signature · 6 lines
2.18.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 28.08.2018 um 18:58 schrieb Michel Dänzer:

Quoted 9 lines

From: Michel Dänzer <[email protected]>

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"
Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index 39d9d559b279..35d53d81f486 100644

drivers/gpu/drm/ttm/ttm_bo.c EXPORT_SYMBOL(ttm_bo_move_to_lru_tail); · line 257

Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -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,
  				    struct list_head *lru, bool is_swap)
  {
-	struct list_head entries, before;
+	LIST_HEAD(entries);
+	LIST_HEAD(before);
  	struct list_head *list1, *list2;
 
  	list1 = is_swap ? &pos->last->swap : &pos->last->lru;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel