[Intel-gfx] [PATCH] drm/i915/selftest/buddy: fixup igt_buddy_alloc_range

Matthew Auld matthew.auld at intel.com
Thu Aug 15 10:32:10 UTC 2019


Dan reported the following static checker warning:

drivers/gpu/drm/i915/selftests/i915_buddy.c:670 igt_buddy_alloc_range()
error: we previously assumed 'block' could be null (see line 665)

Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Dan Carpenter <dan.carpenter at oracle.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/selftests/i915_buddy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_buddy.c b/drivers/gpu/drm/i915/selftests/i915_buddy.c
index b839dd99dd1f..23f784eae1e7 100644
--- a/drivers/gpu/drm/i915/selftests/i915_buddy.c
+++ b/drivers/gpu/drm/i915/selftests/i915_buddy.c
@@ -665,6 +665,7 @@ static int igt_buddy_alloc_range(void *arg)
 		if (!block) {
 			pr_err("alloc_range has no blocks\n");
 			err = -EINVAL;
+			break;
 		}
 
 		if (i915_buddy_block_offset(block) != offset) {
-- 
2.20.1



More information about the Intel-gfx mailing list