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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Signed-off-by: Luo Meng <luomeng12@xxxxxxxxxx>
---
 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

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux