summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-08-07 15:28:32 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-07 16:30:59 +0300
commited29da7123a6275f0b2b1ee05f761b25ab0f20d4 (patch)
tree93c93af6fb3c304c24d4abd52cfbc5210e228820
parent9ae06cad821bbeaca9b34dbb9bdb8591a1d9762a (diff)
downloadlinux-ed29da7123a6275f0b2b1ee05f761b25ab0f20d4.tar.xz
drm/i915: Fix some NULL vs IS_ERR() conditions
There were several places which check for NULL when they should have been checking for IS_ERR(). Fixes: d8af05ff38ae ("drm/i915: Allow sharing the idle-barrier from other kernel requests") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20190807122832.GA10517@mwanda
-rw-r--r--drivers/gpu/drm/i915/gt/selftest_context.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c
index d39b5594cb02..6e7e9a6fd235 100644
--- a/drivers/gpu/drm/i915/gt/selftest_context.c
+++ b/drivers/gpu/drm/i915/gt/selftest_context.c
@@ -86,8 +86,8 @@ static int __live_active_context(struct intel_engine_cs *engine,
}
ce = intel_context_create(fixme, engine);
- if (!ce)
- return -ENOMEM;
+ if (IS_ERR(ce))
+ return PTR_ERR(ce);
for (pass = 0; pass <= 2; pass++) {
struct i915_request *rq;
@@ -161,8 +161,8 @@ static int live_active_context(void *arg)
mutex_lock(&gt->i915->drm.struct_mutex);
fixme = live_context(gt->i915, file);
- if (!fixme) {
- err = -ENOMEM;
+ if (IS_ERR(fixme)) {
+ err = PTR_ERR(fixme);
goto unlock;
}
@@ -226,12 +226,12 @@ static int __live_remote_context(struct intel_engine_cs *engine,
*/
remote = intel_context_create(fixme, engine);
- if (!remote)
- return -ENOMEM;
+ if (IS_ERR(remote))
+ return PTR_ERR(remote);
local = intel_context_create(fixme, engine);
- if (!local) {
- err = -ENOMEM;
+ if (IS_ERR(local)) {
+ err = PTR_ERR(local);
goto err_remote;
}
@@ -274,8 +274,8 @@ static int live_remote_context(void *arg)
mutex_lock(&gt->i915->drm.struct_mutex);
fixme = live_context(gt->i915, file);
- if (!fixme) {
- err = -ENOMEM;
+ if (IS_ERR(fixme)) {
+ err = PTR_ERR(fixme);
goto unlock;
}