|
@@ -358,7 +358,7 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
|
|
|
if (entry->size >= size + wasted) {
|
|
|
if (!best_match)
|
|
|
return entry;
|
|
|
- if (size < best_size) {
|
|
|
+ if (entry->size < best_size) {
|
|
|
best = entry;
|
|
|
best_size = entry->size;
|
|
|
}
|
|
@@ -408,7 +408,7 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
|
|
|
if (entry->size >= size + wasted) {
|
|
|
if (!best_match)
|
|
|
return entry;
|
|
|
- if (size < best_size) {
|
|
|
+ if (entry->size < best_size) {
|
|
|
best = entry;
|
|
|
best_size = entry->size;
|
|
|
}
|