All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: drm: i915: fix error return code of igt_buddy_alloc_smoke()
@ 2021-03-08  8:59 ` Jia-Ju Bai
  0 siblings, 0 replies; 11+ messages in thread
From: Jia-Ju Bai @ 2021-03-08  8:59 UTC (permalink / raw)
  To: jani.nikula, joonas.lahtinen, rodrigo.vivi, airlied, daniel,
	matthew.auld, chris, lkml
  Cc: intel-gfx, dri-devel, linux-kernel, Jia-Ju Bai

When i915_random_order() returns NULL to order, no error return code of
igt_buddy_alloc_smoke() is assigned.
To fix this bug, err is assigned with -EINVAL in this case.

Fixes: 1fe3818d17c9 ("drm/i915/selftests: try to rein in alloc_smoke")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/gpu/drm/i915/selftests/i915_buddy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_buddy.c b/drivers/gpu/drm/i915/selftests/i915_buddy.c
index 632b912b0bc9..cf9b551b77e1 100644
--- a/drivers/gpu/drm/i915/selftests/i915_buddy.c
+++ b/drivers/gpu/drm/i915/selftests/i915_buddy.c
@@ -318,8 +318,10 @@ static int igt_buddy_alloc_smoke(void *arg)
 	}
 
 	order = i915_random_order(mm.max_order + 1, &prng);
-	if (!order)
+	if (!order) {
+		err = -EINVAL;
 		goto out_fini;
+	}
 
 	for (i = 0; i <= mm.max_order; ++i) {
 		struct i915_buddy_block *block;
-- 
2.17.1


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

end of thread, other threads:[~2021-03-08 20:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08  8:59 [PATCH] gpu: drm: i915: fix error return code of igt_buddy_alloc_smoke() Jia-Ju Bai
2021-03-08  8:59 ` [Intel-gfx] " Jia-Ju Bai
2021-03-08  8:59 ` Jia-Ju Bai
2021-03-08  9:18 ` Chris Wilson
2021-03-08  9:18   ` [Intel-gfx] " Chris Wilson
2021-03-08  9:18   ` Chris Wilson
2021-03-08  9:26   ` Jia-Ju Bai
2021-03-08  9:26     ` [Intel-gfx] " Jia-Ju Bai
2021-03-08  9:26     ` Jia-Ju Bai
2021-03-08 14:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-03-08 20:49 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.