summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_memrange.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux-core/drm_memrange.c b/linux-core/drm_memrange.c
index 663943ab..7304cbaa 100644
--- a/linux-core/drm_memrange.c
+++ b/linux-core/drm_memrange.c
@@ -291,10 +291,11 @@ int drm_memrange_for_each(struct drm_memrange *mm,
int ret;
cur = list_entry(list, struct drm_memrange_node, ml_entry);
-
- ret = callback(cur, data);
- if (ret != 0)
- return ret;
+ if (!cur->free) {
+ ret = callback(cur, data);
+ if (ret != 0)
+ return ret;
+ }
}
return 0;