[PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()

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

 



There were two error paths in __cancel_reset() which return success
instead of a negative error code as expected.

Fixes: 4e6835466771 ("drm/i915/selftests: Add a cancel request selftest that triggers a reset")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
>From static analysis.  I am not 100% sure this.  Please review extra
carefully!

 drivers/gpu/drm/i915/selftests/i915_request.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index 2a99dd7c2fe8..05e9f977757b 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -809,7 +809,8 @@ static int __cancel_reset(struct drm_i915_private *i915,
 	preempt_timeout_ms = engine->props.preempt_timeout_ms;
 	engine->props.preempt_timeout_ms = 100;
 
-	if (igt_spinner_init(&spin, engine->gt))
+	err = igt_spinner_init(&spin, engine->gt);
+	if (err)
 		goto out_restore;
 
 	ce = intel_context_create(engine);
@@ -838,8 +839,10 @@ static int __cancel_reset(struct drm_i915_private *i915,
 	}
 
 	nop = intel_context_create_request(ce);
-	if (IS_ERR(nop))
+	if (IS_ERR(nop)) {
+		err = PTR_ERR(nop);
 		goto out_rq;
+	}
 	i915_request_get(nop);
 	i915_request_add(nop);
 
-- 
2.20.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux