All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: chris@chris-wilson.co.uk
Cc: intel-gfx@lists.freedesktop.org
Subject: [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context
Date: Tue, 27 Aug 2019 12:40:16 +0300	[thread overview]
Message-ID: <20190827094016.GC8443@mwanda> (raw)

Hello Chris Wilson,

The patch 75b974a859e5: "drm/i915/selftests: Teach igt_gpu_fill_dw()
to take intel_context" from Aug 24, 2019, leads to the following
static checker warning:

	drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:402 igt_ctx_exec()
	error: 'ce' dereferencing possible ERR_PTR()

drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
   388                  dw = 0;
   389                  while (!time_after(jiffies, end_time)) {
   390                          struct i915_gem_context *ctx;
   391                          struct intel_context *ce;
   392  
   393                          ctx = live_context(i915, file);
   394                          if (IS_ERR(ctx)) {
   395                                  err = PTR_ERR(ctx);
   396                                  goto out_unlock;
   397                          }
   398  
   399                          ce = i915_gem_context_get_engine(ctx, engine->legacy_idx);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
New assignment.  Smatch thinks it can be ERR_PTR(-EINVAL)

   400  
   401                          if (!obj) {
   402                                  obj = create_test_object(ce->vm, file, &objects);
                                                                 ^^^^^^
Dereference.

   403                                  if (IS_ERR(obj)) {
   404                                          err = PTR_ERR(obj);
   405                                          intel_context_put(ce);
   406                                          goto out_unlock;
   407                                  }
   408                          }
   409  
   410                          err = gpu_fill(ce, obj, dw);
   411                          intel_context_put(ce);
   412  
   413                          if (err) {
   414                                  pr_err("Failed to fill dword %lu [%lu/%lu] with gpu (%s) in ctx %u [full-ppgtt? %s], err=%d\n",
   415                                         ndwords, dw, max_dwords(obj),
   416                                         engine->name, ctx->hw_id,
   417                                         yesno(!!ctx->vm), err);
   418                                  goto out_unlock;
   419                          }

See also:

drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:410 igt_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:528 igt_shared_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:534 igt_shared_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()

regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2019-08-27  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27  9:40 Dan Carpenter [this message]
2019-08-27  9:45 ` [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context Chris Wilson

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=20190827094016.GC8443@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.