blob: 063840583c375cc7be883a7690c03ff7f5192d04 [file] [log] [blame]
From 5f2080753b313e79d65eb821e7351dbed88db687 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <>
Date: Fri, 28 Feb 2020 17:14:13 +0300
Subject: [PATCH] drm/i915/selftests: Fix return in assert_mmap_offset()
commit f4aaa44e8b20f7e0d4ea68d3bca4968b6ae5aaff upstream.
The assert_mmap_offset() returns type bool so if we return an error
pointer that is "return true;" or success. If we have an error, then
we should return false.
Fixes: 3d81d589d6e3 ("drm/i915: Test exhaustion of the mmap space")
Signed-off-by: Dan Carpenter <>
Reviewed-by: Chris Wilson <>
Signed-off-by: Chris Wilson <>
(cherry picked from commit efbf928824820f2738f41271934f6ec2c6ebd587)
Signed-off-by: Jani Nikula <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
index 971148fbe6f5..54ddd86e45cf 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
@@ -493,7 +493,7 @@ static bool assert_mmap_offset(struct drm_i915_private *i915,
obj = i915_gem_object_create_internal(i915, size);
if (IS_ERR(obj))
- return PTR_ERR(obj);
+ return false;
err = i915_gem_object_create_mmap_offset(obj);