drm: Fix a bug in the range manager.
Subsystems (2)
PATCH RESEND 1/2 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 Thomas Hellstrom <[email protected]>
--- drivers/gpu/drm/drm_mm.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/drm_mm.c +2 -1
@@ -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) {
Signature · 8 lines
1.6.2.5 ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev --