From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Matthew Brost <matthew.brost@intel.com>
Cc: kernel-janitors@vger.kernel.org,
"Michał Winiarski" <michal.winiarski@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"David Airlie" <airlied@linux.ie>,
"Zhihao Cheng" <chengzhihao1@huawei.com>,
intel-gfx@lists.freedesktop.org,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Chris Wilson" <chris@chris-wilson.co.uk>
Subject: [Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()
Date: Thu, 27 Jan 2022 11:49:15 +0300 [thread overview]
Message-ID: <20220127084915.GC25644@kili> (raw)
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@oracle.com>
---
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
next reply other threads:[~2022-01-27 8:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 8:49 Dan Carpenter [this message]
2022-01-27 9:57 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests: fix some error codes in __cancel_reset() Patchwork
2022-01-28 0:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: fix some error codes in __cancel_reset() (rev2) Patchwork
2022-01-28 5:16 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-04 17:45 ` [Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset() Andi Shyti
2022-02-04 21:46 ` Rodrigo Vivi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220127084915.GC25644@kili \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=chengzhihao1@huawei.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.brost@intel.com \
--cc=michal.winiarski@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox