Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm: Fix a infinite loop condition when order becomes 0
@ 2022-03-14 19:40 Arunpravin
  2022-03-15  1:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Arunpravin @ 2022-03-14 19:40 UTC (permalink / raw)
  To: intel-gfx, dri-devel, amd-gfx
  Cc: alexander.deucher, Arunpravin, matthew.auld, christian.koenig

handle a situation in the condition order-- == min_order,
when order = 0, leading to order = -1, it now won't exit
the loop. To avoid this problem, added a order check in
the same condition, (i.e) when order is 0, we return
-ENOSPC

Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
---
 drivers/gpu/drm/drm_buddy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 72f52f293249..5ab66aaf2bbd 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -685,7 +685,7 @@ int drm_buddy_alloc_blocks(struct drm_buddy *mm,
 			if (!IS_ERR(block))
 				break;
 
-			if (order-- == min_order) {
+			if (!order || order-- == min_order) {
 				err = -ENOSPC;
 				goto err_free;
 			}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-21  6:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-14 19:40 [Intel-gfx] [PATCH] drm: Fix a infinite loop condition when order becomes 0 Arunpravin
2022-03-15  1:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-03-15  5:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-03-15  8:19 ` [Intel-gfx] [PATCH] " Paul Menzel
2022-03-15  9:01   ` Arunpravin
2022-03-15  9:05     ` Paul Menzel
2022-03-15 15:42       ` Arunpravin
2022-03-15 15:44         ` Paul Menzel
2022-03-16  6:49           ` Arunpravin Paneer Selvam
2022-03-16  6:58             ` Paul Menzel
2022-03-21  6:15               ` Arunpravin Paneer Selvam
2022-03-15 11:31 ` Matthew Auld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox