[Intel-gfx] [PATCH] drm/i915: fix error return code in check_partial_mapping()

Luo Meng luomeng12 at huawei.com
Wed Nov 25 01:29:38 UTC 2020


Fix to return a negative error code from the error handling case
instead of 0 in function check_partial_mapping(), as done elsewhere
in this function.

Fixes: 07e98eb0a174 ("drm/i915/selftests: Tighten the timeout testing for partial mmaps")
Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: Luo Meng <luomeng12 at huawei.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index d27d87a678c8..3f5e7d0a3c53 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -137,8 +137,10 @@ static int check_partial_mapping(struct drm_i915_gem_object *obj,
 	i915_vma_unpin_iomap(vma);
 
 	offset = tiled_offset(tile, page << PAGE_SHIFT);
-	if (offset >= obj->base.size)
+	if (offset >= obj->base.size) {
+		err = -EINVAL;
 		goto out;
+	}
 
 	intel_gt_flush_ggtt_writes(&to_i915(obj->base.dev)->gt);
 
-- 
2.25.4



More information about the Intel-gfx mailing list