diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-07-18 14:24:49 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-07-18 14:24:56 +0200 |
commit | 21634f0f307c8401462da2cd07507880ee17d3fc (patch) | |
tree | 8dd1b41a5a1bd9fe9a340814c4101f33df827f40 /drivers/gpu/drm/ttm/ttm_resource.c | |
parent | 6d68d9cba1d0d1ee628a783eb9e7d38a0c3691b8 (diff) | |
parent | 2218e10e6fec05f76d6cd2c7eed4cb5af447360b (diff) |
Merge branch 'topic/hda-pci-ids' into for-next
Pull cleanup of HD-audio PCI IDs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_resource.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_resource.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index 7333f7a87a2f..46ff9c75bb12 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -86,6 +86,8 @@ static void ttm_lru_bulk_move_pos_tail(struct ttm_lru_bulk_move_pos *pos, struct ttm_resource *res) { if (pos->last != res) { + if (pos->first == res) + pos->first = list_next_entry(res, lru); list_move(&res->lru, &pos->last->lru); pos->last = res; } @@ -111,7 +113,8 @@ static void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk, { struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res); - if (unlikely(pos->first == res && pos->last == res)) { + if (unlikely(WARN_ON(!pos->first || !pos->last) || + (pos->first == res && pos->last == res))) { pos->first = NULL; pos->last = NULL; } else if (pos->first == res) { |