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: Live testing for context execution
Date: Mon, 13 Mar 2017 15:34:29 +0300	[thread overview]
Message-ID: <20170313123429.GA9426@mwanda> (raw)

Hello Chris Wilson,

The patch 791ff39ae32a: "drm/i915: Live testing for context
execution" from Feb 13, 2017, leads to the following static checker
warning:

	drivers/gpu/drm/i915/selftests/i915_gem_context.c:347 igt_ctx_exec()
	error: 'file' dereferencing possible ERR_PTR()

drivers/gpu/drm/i915/selftests/i915_gem_context.c
   320  static int igt_ctx_exec(void *arg)
   321  {
   322          struct drm_i915_private *i915 = arg;
   323          struct drm_file *file = mock_file(i915);
                                 ^^^^^^^^^^^^^^^^^^^^^^
We don't check this for IS_ERR().

   324          struct drm_i915_gem_object *obj;
   325          IGT_TIMEOUT(end_time);
   326          LIST_HEAD(objects);
   327          unsigned long ncontexts, ndwords, dw;
   328          bool first_shared_gtt = true;
   329          int err;
   330  
   331          /* Create a few different contexts (with different mm) and write
   332           * through each ctx/mm using the GPU making sure those writes end
   333           * up in the expected pages of our obj.
   334           */
   335  
   336          mutex_lock(&i915->drm.struct_mutex);
   337  
   338          ncontexts = 0;
   339          ndwords = 0;
   340          dw = 0;
   341          while (!time_after(jiffies, end_time)) {
   342                  struct intel_engine_cs *engine;
   343                  struct i915_gem_context *ctx;
   344                  unsigned int id;
   345  
   346                  if (first_shared_gtt) {
   347                          ctx = __create_hw_context(i915, file->driver_priv);
   348                          first_shared_gtt = false;
   349                  } else {
   350                          ctx = i915_gem_create_context(i915, file->driver_priv);
   351                  }
   352                  if (IS_ERR(ctx)) {
   353                          err = PTR_ERR(ctx);
   354                          goto out_unlock;

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

             reply	other threads:[~2017-03-13 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 12:34 Dan Carpenter [this message]
2017-03-13 12:47 ` [bug report] drm/i915: Live testing for context execution 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=20170313123429.GA9426@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.