Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 775c6709 authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie
Browse files

drm: Fix a bug in the range manager.



When searching for free space in a range, the function could return a node extending outside of the given range.

Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 724e6d3f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -405,7 +405,8 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
				wasted += alignment - tmp;
		}

		if (entry->size >= size + wasted) {
		if (entry->size >= size + wasted &&
		    (entry->start + wasted + size) <= end) {
			if (!best_match)
				return entry;
			if (entry->size < best_size) {