[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200817143841.142266377@linuxfoundation.org>
Date: Mon, 17 Aug 2020 17:11:46 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Nirmoy Das <nirmoy.das@....com>,
Christian König <christian.koenig@....com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.8 153/464] drm/mm: fix hole size comparison
From: Nirmoy Das <nirmoy.aiemd@...il.com>
[ Upstream commit 18ece75d7d74eb108f6a7325cf247077a666cba8 ]
Fixes: 0cdea4455acd350a ("drm/mm: optimize rb_hole_addr rbtree search")
Signed-off-by: Nirmoy Das <nirmoy.das@....com>
Reported-by: Christian König <christian.koenig@....com>
Reviewed-by: Christian König <christian.koenig@....com>
Signed-off-by: Christian König <christian.koenig@....com>
Link: https://patchwork.freedesktop.org/patch/367726/
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpu/drm/drm_mm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index f4ca1ff80af9f..60e9a9c91e9d9 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -407,7 +407,7 @@ next_hole_high_addr(struct drm_mm_node *entry, u64 size)
left_node = rb_entry(left_rb_node,
struct drm_mm_node, rb_hole_addr);
if ((left_node->subtree_max_hole < size ||
- entry->size == entry->subtree_max_hole) &&
+ HOLE_SIZE(entry) == entry->subtree_max_hole) &&
parent_rb_node && parent_rb_node->rb_left != rb_node)
return rb_hole_addr_to_node(parent_rb_node);
}
@@ -447,7 +447,7 @@ next_hole_low_addr(struct drm_mm_node *entry, u64 size)
right_node = rb_entry(right_rb_node,
struct drm_mm_node, rb_hole_addr);
if ((right_node->subtree_max_hole < size ||
- entry->size == entry->subtree_max_hole) &&
+ HOLE_SIZE(entry) == entry->subtree_max_hole) &&
parent_rb_node && parent_rb_node->rb_right != rb_node)
return rb_hole_addr_to_node(parent_rb_node);
}
--
2.25.1
Powered by blists - more mailing lists