All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drm/i915: Live testing for context execution
@ 2017-03-13 12:34 Dan Carpenter
  2017-03-13 12:47 ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-03-13 12:34 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] drm/i915: Live testing for context execution
  2017-03-13 12:34 [bug report] drm/i915: Live testing for context execution Dan Carpenter
@ 2017-03-13 12:47 ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2017-03-13 12:47 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: intel-gfx

On Mon, Mar 13, 2017 at 03:34:29PM +0300, Dan Carpenter wrote:
> 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()

Thanks again,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-13 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 12:34 [bug report] drm/i915: Live testing for context execution Dan Carpenter
2017-03-13 12:47 ` Chris Wilson

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.