diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-02-12 00:17:59 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-15 11:19:14 +1000 |
commit | 775c67090c98780b44c4f95d5c05565df715b8bd (patch) | |
tree | 8326fb57dc82a90fb609f1fe5d32372aba3ea6f0 /drivers/gpu | |
parent | 724e6d3fe8003c3f60bf404bf22e4e331327c596 (diff) | |
download | op-kernel-dev-775c67090c98780b44c4f95d5c05565df715b8bd.zip op-kernel-dev-775c67090c98780b44c4f95d5c05565df715b8bd.tar.gz |
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 <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_mm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index cdec329..2ac074c8 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -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) { |