mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-01-02 07:40:16 +01:00
[gem] Fix bad test for list_for_each completion.
Since it's a circular list, the entry won't be NULL at termination.
This commit is contained in:
parent
7078978db0
commit
54fa32cdfe
1 changed files with 8 additions and 3 deletions
|
|
@ -478,14 +478,19 @@ i915_gem_evict_something(struct drm_device *dev)
|
|||
struct drm_i915_gem_object,
|
||||
list);
|
||||
} else if (!list_empty(&dev_priv->mm.active_list)) {
|
||||
int found = 0;
|
||||
|
||||
/* If there's nothing unused and ready, grab the first
|
||||
* unpinned object from the currently executing list.
|
||||
*/
|
||||
list_for_each_entry(obj_priv, &dev_priv->mm.active_list,
|
||||
list)
|
||||
if (obj_priv->pin_count == 0)
|
||||
list) {
|
||||
if (obj_priv->pin_count == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
if (!obj_priv)
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue